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.
QtWS25 Last Chance

How to trigger QMenu on right click.

Scheduled Pinned Locked Moved Unsolved General and Desktop
qmenuqactionqt4
3 Posts 3 Posters 3.6k Views
  • 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 16 Nov 2016, 07:41 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
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 16 Nov 2016, 08:04 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
      • M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 16 Nov 2016, 14:20 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

        2/3

        16 Nov 2016, 08:04

        • Login

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