What is the proper way of triggering a function if the mouse cursor hovers over a QButton?
To be more precise I have a label called statusLabel which should show messag
You have to create your own class, derived of QPushButton (or whichever class you want to capture hover events in).
In this class, you can override QWidget::enterEvent() to detect when the mouse hovers your widget and call your function. What you can for example do is emit a custom signal that will trigger the erasing of your label.