PYQT5点击菜单栏弹出新窗口,解决窗口闪退的问题
需要通过self实例化为全局变量,不加self的话,一运行就会被收回,所以无法显示
def rabbit_talk(self):
try:
from asrInterface import Ui_Dialog
'''要加self'''
self.Dialog = QMainWindow()
Ui_Dialog().setupUi(self.Dialog)
self.Dialog.show()
except Exception as e:
print(e)