I am creating a small PyQt application and got stuck up in MouseOver effect.
I have a QMainWindow
which has three buttons named createProfileButton
, downloadPackagesButton
and installPackagesButton
. All these are of type QPushButton
Now I have created a Label which will hold the text when someone hovers the mouse over any of these button. I checked the documentation and came to know that it can be handled using over-riding
- focusInEvent(self, QFocusEvent)
- focusOutEvent(self, QFocusEvent)
methods of the button. Now this means that I have to extend QPushButton
for each of the three buttons and each one of them have to an object for one class. I tried hunting for the signal which is emitted when mouse is hovered or taken away from the button, but in vain. All help I got on the net was to implement these two methods.
Isnt extending a class and creating one of each an overkill? A signal would be neat, unfortunately, I couldn't find any signal.
- http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qpushbutton.html - Has no signals
- http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qabstractbutton.html - Has clicked, released, pressed and toggled signals
- http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qwidget.html - Has only one method
So I checked the whole inheritance hierarchy and found no signal for FocusIn
and FocusOut