QT

1、将UI文件转化为PY文件

Python - m pyqt5.uic.pyuic demo.ui - o demo.py

方法二:

pyuic.exe demo.ui -o demo.py

C:\Users\lion\PycharmProjects\pythonProject1\venv\Scripts\pyuic5.exe

# 需要安装pyuic

 

2、调用UI.py

import sys
import FdUI
from PyQt5.Qt import *
if __name__ =='__main__':
app = QApplication(sys.argv)
#声明主窗口
mainwindow = QMainWindow()
#初始化UI类实例
ui = FdUI.Ui_MainWindow()
#绑定主窗口与UI
ui.setupUi(mainwindow)
mainwindow.show()
sys.exit(app.exec_())
3、信号与槽
posted on 2022-04-04 18:12  Lionever  阅读(24)  评论(0编辑  收藏  举报