, Python (PySide):
def event(self, event):
if event.type() == QtCore.QEvent.EnterWhatsThisMode:
print "click"
return True
return QtGui.QDialog.event(self, event)
That is, you redefine eventwhen the application enters "WhatsThisMode". Otherwise, go back to the base class.
It almost works. The only wrinkle is that the mouse cursor is still turning into the Forbidden form. Based on another post, I got rid of this by adding:
QtGui.QWhatsThis.leaveWhatsThisMode()
Like the line before the print command in the previous one.
source
share