kindle manager
This commit is contained in:
75
kmanapp.py
75
kmanapp.py
@@ -1,23 +1,76 @@
|
||||
# This Python file uses the following encoding: utf-8
|
||||
|
||||
import sys
|
||||
from PySide2.QtWidgets import QApplication
|
||||
from PySide2.QtWidgets import QApplication
|
||||
from PySide2.QtWidgets import QMainWindow
|
||||
from mainwindow import Ui_MainWindow # 加载我们的布局
|
||||
from mainwindow import Ui_MainWindow
|
||||
|
||||
|
||||
class UsingTest(QMainWindow, Ui_MainWindow):
|
||||
class kmanWindow(QMainWindow):
|
||||
"""
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(UsingTest, self).__init__(*args, **kwargs)
|
||||
self.setupUi(self) # 初始化ui
|
||||
# 在这里,可以做一些UI的操作了,或者是点击事件或者是别的
|
||||
# 也可以另外写方法,可以改变lable的内容
|
||||
super(kmanWindow, self).__init__(*args, **kwargs)
|
||||
"""
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super(kmanWindow, self).__init__(parent)
|
||||
|
||||
# create ui and initial it
|
||||
ui = Ui_MainWindow()
|
||||
ui.setupUi(self)
|
||||
self.ui = ui
|
||||
|
||||
# connect action to slot functions
|
||||
ui.actionimportkindle.triggered.connect(lambda: self.importkindle())
|
||||
ui.actionimportlocal.triggered.connect(lambda: self.importlocal())
|
||||
ui.actionconfig.triggered.connect(lambda: self.config())
|
||||
ui.actionwords.triggered.connect(lambda: self.words())
|
||||
ui.actionstatistic.triggered.connect(lambda: self.statistic())
|
||||
ui.actionhomepage.triggered.connect(lambda: self.homepage())
|
||||
ui.actionabout.triggered.connect(lambda: self.about())
|
||||
ui.actionflush.triggered.connect(lambda: self.flush())
|
||||
|
||||
# define slot functions
|
||||
def importkindle():
|
||||
print("call slot importkindle()")
|
||||
pass
|
||||
|
||||
def importlocal():
|
||||
print("call slot importlocal()")
|
||||
pass
|
||||
|
||||
def config():
|
||||
print("call slot config()")
|
||||
pass
|
||||
|
||||
def words():
|
||||
print("call slot words()")
|
||||
pass
|
||||
|
||||
def statistic():
|
||||
print("call slot statistic()")
|
||||
pass
|
||||
|
||||
def homepage():
|
||||
print("call slot homepage()")
|
||||
pass
|
||||
|
||||
def about():
|
||||
print("call slot about()")
|
||||
pass
|
||||
|
||||
def flush():
|
||||
print("call slot flush()")
|
||||
pass
|
||||
|
||||
def messageBox(self, showInfo):
|
||||
box = QMessageBox.about(self, 'Kindle Management', showInfo)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
from PySide2.QtWidgets import QApplication, QLabel
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
mw = UsingTest()
|
||||
mw.show()
|
||||
kmw = kmanWindow()
|
||||
kmw.resize(900, 600)
|
||||
kmw.show()
|
||||
app.exec_()
|
||||
|
||||
Reference in New Issue
Block a user