在QMainWindow的模式中,有时会出现出现一次点击QAction,但是响应多次triggered信号的情况,这种方式可以借助异常处理进行过滤:
@QtCore.pyqtSlot()
def on_yourAction_triggered(self):
try:
self.actionPVC.triggered.disconnect()
except:
pass
在QMainWindow的模式中,有时会出现出现一次点击QAction,但是响应多次triggered信号的情况,这种方式可以借助异常处理进行过滤:
@QtCore.pyqtSlot()
def on_yourAction_triggered(self):
try:
self.actionPVC.triggered.disconnect()
except:
pass