I would like to launch a process within a QMessageBox subclass before it returns via the AcceptRole. It's not clear to me why the following does not work:
class Question(QtGui.QMessageBox):
def __init__(self, text):
QtGui.QMessageBox.__init__(self, QtGui.QMessageBox.Question,
"title", text, buttons=QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel)
self.text = text
def accept(self):
# run opertation
print self.text
QtGui.QMessageBox.accept(self)
dial = Question("text")
dial.exec_()
Since the buttonRole for QMessageBox.Ok is AcceptRole, I would expect accept()
to be called. Is this not the case?
Any insight would be appreciated.