添加代碼運行python
app = QtWidgets.QApplication(sys.argv) mainWindow = QtWidgets.QMainWindow() ui = Ui_Dialog() # 對應的 Class名 ui.setupUi(mainWindow) mainWindow.resize(624, 511) mainWindow.setFixedSize(624,511) mainWindow.setWindowTitle('hello world') mainWindow.show() sys.exit(app.exec_())