Mouse-over Event for QPushButton



  • Hi everyone. The QPushButton doesn't have hover(mouse-over) slot. Do i have to subclass or is there a possibility to add this function to the qpushbutton?


  • Qt Champions 2017

    Hi
    Normally you subclass the pushbutton and add it.
    When this is not practical, an event filter can be used but
    subclass is both easier and faster. (IMHO)

    Note. Using Creators promote feature, u can have QPushButtons in the UI replaced
    with your subclass very easy.
    http://doc.qt.io/qt-4.8/designer-using-custom-widgets.html

    Think of promote as "Replace at runtime" without you do anything.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.