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. Send event on hover of QMenu items
Qt 6.11 is out! See what's new in the release blog

Send event on hover of QMenu items

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 1.2k 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
    Sougata1996
    wrote on last edited by
    #1

    Quick question , how can i send events on hover of QMenu Action items , I am doing something like this but don't see the call come to the slot , what am i doing wrong here ?

    QObject::connect(menu->menuAction(), SIGNAL(QAction::hovered()), this, SLOT(hover()));

    I also want to send some event on "hover end" of action item . Can someone help me with this ?

    Thanks

    JonBJ 1 Reply Last reply
    0
    • S Sougata1996

      Quick question , how can i send events on hover of QMenu Action items , I am doing something like this but don't see the call come to the slot , what am i doing wrong here ?

      QObject::connect(menu->menuAction(), SIGNAL(QAction::hovered()), this, SLOT(hover()));

      I also want to send some event on "hover end" of action item . Can someone help me with this ?

      Thanks

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @Sougata1996
      Please start by doing yourself a favor and changing over to the new signal & slots syntax. You might even find that tells you what is wrong....

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

        Hi,

        Beside the good suggestion of @JonB, you should also have a runtime warning that there's something wrong with your connection.

        That said, QAction has no physical aspect. The hovered signal you are looking for is in QMenu itself.

        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
        2
        • S Offline
          S Offline
          Sougata1996
          wrote on last edited by
          #4

          Thanks for the help , i was able to find a solution .

          1 Reply Last reply
          1

          • Login

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