Important: Please read the Qt Code of Conduct -

[SOLVED] QPushButton with own icon has no rollover effect

  • Hi,

    I would like to have a customized button.

    For that I placed in "Qt Creator"->"Design" a "Push Button" in my window. In the properties menu of the "Push Button" I set my icon. To have effects like rollover, pressed I tried to set various icons ( Normal on/off, Active on/off, Disabled on/off, Selected on/off ...).

    My problem is that the button doesn't react if my mouse rolls over the icon. I thought that I have only to set the properties in the Designer. Do I have to write some additional code for this rollover effect? Or is a property missing? Any ideas?


  • Lifetime Qt Champion


    By rollover, do you mean hover ? In any case, if you want to modify the icon when the mouse hovers your button, you'll have to implement that yourself. Have a look at the "QHoverEvent":

    Hope it helps

Log in to reply