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 ignore click that closes/hides the contextual menu ?

How to ignore click that closes/hides the contextual menu ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 710 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.
  • J Offline
    J Offline
    JohnDoh
    wrote on last edited by
    #1

    Hello,

    I am facing a problem where an event is processed when I left click to exit from the contextual menu.

    1. Right click -> Contextual menu appears
    2. Left click anywhere but on any contextual action -> the contextual menu disappears as expected
    3. That left click is processed as a standard left click and initiate some stuff I don't want, I just wanted to exit from contextual menu.

    How can I prevent from that ?

    Thank you!

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

      Hi and welcome to devnet,

      What does happen ?
      On what kind of widget does it happen ?
      What OS ?
      What Qt version ?

      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
      • J Offline
        J Offline
        JohnDoh
        wrote on last edited by
        #3

        Win7, Qt 5.9.1

        It is a QWidget that handle a plotter paint area where we draw curves.
        The left click starts to edit the curve as a normal left click would do but that particular left click was just supposed to close/hide the contextual menu and nothing more.

        mrjjM 1 Reply Last reply
        0
        • J JohnDoh

          Win7, Qt 5.9.1

          It is a QWidget that handle a plotter paint area where we draw curves.
          The left click starts to edit the curve as a normal left click would do but that particular left click was just supposed to close/hide the contextual menu and nothing more.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @JohnDoh

          So the issue is that clicking outside the context popup menu does close the menu but ALSO triggers
          an action just as if user clicked directly on it ?

          Please make a small default GUI project and try it there so we are sure its not
          something in your code that does it. :)

          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