Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to create slot for QMenu.clicked
Qt 6.11 is out! See what's new in the release blog

How to create slot for QMenu.clicked

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 3 Posters 5.1k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello,

    I want to run some code when QMenu is clicked, not its child QAction.

    How to do that`?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      task_struct
      wrote on last edited by
      #2

      Hello,

      QMenu has signal "triggered":http://qt-project.org/doc/qt-4.8/qmenu.html#triggered I think this is what you are looking for.

      "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program."

      • Linu...
      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Is it QMenuBar::triggered() you are after? If you really mean QMenu, then what is the problem with using QAction?

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          I want to use QMenu but I don't want that it has a submenu.
          So, I have a QMenuBar and many QMenus. These QMenus don't have submenus QAction, I have already tried with submenus and their triggered signal but howto edit these signals in the Designer, I can't right click on the QMenu, but only on the submenu and edit their signals.

          This is how it looks like:
          !http://t92.img-up.net/Screenshoto6tx.png(QMenu)!

          I don't want these QActions but more QMenus.

          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