python PyQt5 逻辑与界面分离

 蓝色智慧 发表于 2022年12月22日 软件编程  26
蓝色智慧
LV 7 [大学]
最后在线:13天前
加入时间:2年前
主帖:233  跟帖:5
import sys
from PyQt5.QtWidgets import QMainWindow, QApplication
# 用下面的代码就可以直接调用QtDesigner生成的窗口,无需修改任何代码
from u222 import Ui_MainWindow  # 1、引入窗口

class MyUi(QMainWindow,Ui_MainWindow):  # 2、后一个参数为要调用的窗口
    def __init__(self):
        super(MyUi, self).__init__()
        self.setupUi(self)  # 初始化窗口
        
if __name__ == '__main__':
    app = QApplication(sys.argv)
    win = MyUi()
    win.show()
    sys.exit(app.exec_())
论坛主帖
234
论坛跟帖
2
在线访客
2
今日主帖
0
今日跟帖
0
今日注册
0
277
http://www.76w.net/sq/index.php/gentie.html
http://www.76w.net/sq/index.php/postzan.html
http://www.76w.net/sq/index.php/postcai.html
http://www.76w.net/sq/index.php/postshoucang.html
http://www.76w.net/sq/index.php/gentiezan.html
http://www.76w.net/sq/index.php/gentiecai.html
http://www.76w.net/sq/index.php/huifu.html
http://www.76w.net/sq/index.php/xiugai.html
http://www.76w.net/sq/index.php/shanchugentie.html
1
XzA=
1
© 2023 天慧网·互动社区 版权所有
Powered by JianYuLunTan
蒙ICP备2021000971号-1
http://www.76w.net/sq/index.php/feedback.html
http://www.76w.net/sq/index.php/qiandao.html
http://www.76w.net/sq/index.php/denglu.html
0
http://www.76w.net/sq/index.php/adenglu.html
剑鱼论坛