我想在单击QMessageBox上的“Ok”按钮时调用“RemovedUpplicate”方法。但是,当我单击按钮时,该方法不会执行。我该怎么办? 以下是我的代码片段:
def removeDuplicate(self):
curItem = self.listWidget_2.currentItem()
self.listWidget_2.takeItem(curItem)
def error_popup(self):
msg=QtWidgets.QMessageBox()
msg.setText("You can't select more than one wicket-keeper.")
msg.setWindowTitle(" ")
msg.setIcon(QtWidgets.QMessageBox.Critical)
x = msg.exec_()
msg.setStandardButtons(QtWidgets.QMessageBox.Ok)
msg.buttonClicked.connect(self.removeDuplicate)
试试看:
相关问题 更多 >
编程相关推荐