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. how to detect menu selection /click?
Forum Updated to NodeBB v4.3 + New Features

how to detect menu selection /click?

Scheduled Pinned Locked Moved Unsolved General and Desktop
this
2 Posts 2 Posters 334 Views 2 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by Anonymous_Banned275
    #1

    SOLVED

    This is really stupid question , but how to detect / capture menu selection ?
    I have code build , not QtDesigner GUI , menu with submenus and cannot figure our how to capture sub menu selection / mouse click on sub menu.
    All that is pretty easy using QtDesigner, but I need C++ code to do that.
    I been trying "connect" but it is messy and does not work well. ( Hard to keep track,,,)

    Suggestions are OK, I can code ...
    Sample in C++ would be great, even "button push" ...
    Thanks

    Christian EhrlicherC 1 Reply Last reply
    0
    • A Anonymous_Banned275

      SOLVED

      This is really stupid question , but how to detect / capture menu selection ?
      I have code build , not QtDesigner GUI , menu with submenus and cannot figure our how to capture sub menu selection / mouse click on sub menu.
      All that is pretty easy using QtDesigner, but I need C++ code to do that.
      I been trying "connect" but it is messy and does not work well. ( Hard to keep track,,,)

      Suggestions are OK, I can code ...
      Sample in C++ would be great, even "button push" ...
      Thanks

      Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      A menu has an action (as already told you more than once) so you should look at the signals of QAction and you will find

      • hovered
      • triggered
      • toggled

      So connect those signals to a slot and you will get notified.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      6

      • Login

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