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 347 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 5 Feb 2024, 03:05 last edited by Anonymous_Banned275 2 May 2024, 04:20
    #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

    C 1 Reply Last reply 5 Feb 2024, 05:17
    0
    • A Anonymous_Banned275
      5 Feb 2024, 03:05

      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

      C Online
      C Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 5 Feb 2024, 05:17 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

      1/2

      5 Feb 2024, 03:05

      • Login

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