Qt DesignerPyQt5
安裝pyqt5
pip install pyqt5
安裝Designer
pip install pyqt5-tools
UI文件轉成py
pyuic5 -o SerialCom.py SerialCom.ui
资源文件轉成py,包括图标
pyrcc5.exe ico_globalnet.qrc -o ico_globalnet_rc.py
Pycharm 集成 Qt Designer
添加Main函數
if __name__ == '__main__':
import sys
from PyQt5.QtWidgets import QApplication,QMainWindow
app = QApplication(sys.argv)
Mainwindow = QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(Mainwindow)
Mainwindow.show()
sys.exit(app.exec_())