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 trigger QMenu on right click.
Forum Updated to NodeBB v4.3 + New Features

How to trigger QMenu on right click.

Scheduled Pinned Locked Moved Unsolved General and Desktop
qmenuqactionqt4
3 Posts 3 Posters 3.7k 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.
  • T Offline
    T Offline
    tokafr
    wrote on last edited by
    #1

    Hello all.
    I am creating QMenu object in the function of my class and I connect this object to one of my slots using

    connect(menu, SIGNAL(triggered(QAction*), SLOT(myslot(QAction*)));
    

    It works ok for left button click, but for right button click it doesn't emits triggered signal and the slot is not calling.
    can I do the same for both side button click without subclassing QMenu and reimplement of mouseEvent method?

    thank you.

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

      Hi,

      The menus example should contain the info you need.

      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
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        Just as a note.
        No (dropdown) menus I have ever used can be triggered by right clicking. ( some offer properties this way)
        so can I ask why you need that?

        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