【发布时间】:2017-09-26 09:08:34
【问题描述】:
我不太了解 PySide 中的事件处理。 当我尝试类似:
exitAction.triggered.connect(self.close)
exitAction 以前是 QAction 用于退出程序的地方,它工作得很好。但是当我做类似的东西时怎么会
newAction.triggered.connect(QMessageBox.information(self, 'New document', "New document is being created...", QMessageBox.Ok))
它不工作?每当我启动程序时,它都会显示 QMessageBox,而不是当我单击工具栏/菜单栏上的 QAction 时。由于单击 QAction,我将如何继续实现 QMessageBox?非常感谢任何帮助!
【问题讨论】:
标签: python user-interface event-handling pyqt pyside