Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] QPushButton with own icon has no rollover effect
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] QPushButton with own icon has no rollover effect

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 978 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Snowseeker
    wrote on last edited by
    #1

    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?

    Thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      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":http://qt-project.org/doc/qt-5/qhoverevent.html.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved