pyQt5教程
当使用QTdesinger设计好界面,再使用pyuic转成.py脚本文件后,简单得对内部逻辑进行构造的实示例。
import sys
from PyQt5
.QtWidgets
import QApplication
, QMainWindow
from mainWindow
import *
class MyWindow(QMainWindow
, Ui_MainWindow
):
def __init__(self
, parent
=None):
super(MyWindow
, self
).__init__
(parent
)
self
.setupUi
(self
)
self
.Buttonname
.clicked
.connect
(self
.beginfunc
)
def beginfunc(self
):
k
= int(self
.clusternum
.toPlainText
())
if __name__
== '__main__':
app
= QApplication
(sys
.argv
)
myWin
= MyWindow
()
myWin
.show
()
sys
.exit
(app
.exec_
())
转载请注明原文地址: https://yun.8miu.com/read-21737.html