首页上一页 1 下一页尾页 2 条记录 1/1页
PyQt5界面分离后主窗口按钮如何打开设计好的其他界面
发表在Python图书答疑
2022-03-21
《PyQt5&Python游戏开发》第4章 PyQt5窗口设计基础
是否精华
是
否
版块置顶:
是
否
1 LuoJiFenLi.py from PyQt6 import QtWidgets from ZhuCeChuangKou import Ui_ZhuCeChuangKou from ZhuChuangKou import Ui_ZhuChuangKou class MainWindow(QtWidgets.QMainWindow,Ui_ZhuChuangKou): def __init__(self,): super(MainWindow, self).__init__() self.setWindowTitle("不会飞的dog") self.setupUi(self) #注册事 self.ZhuCeBtn.clicked.connect(self.zhu_ce) def zhu_ce(self): # 点击注册 弹出新窗口 print("调用zhu_ce") ui2=Mui2() ui2.show() class Mui2(QtWidgets.QMainWindow,Ui_ZhuCeChuangKou): def __init__(self,): super(Mui2, self).__init__() self.setWindowTitle("不会飞的dog") self.setupUi(self) 2 QiDongCuangKou.py from PyQt6 import QtWidgets from LuoJiFenLi import MainWindow # from LuoJiFenLi import Mui2 import sys if __name__ == "__main__": app = QtWidgets.QApplication(sys.argv) mainWindow = MainWindow() # mainWindow2=Mui2() # mainWindow2.show() mainWindow.show() sys.exit(app.exec())
于2022-03-21 15:55:46编辑