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. QContextMenuEvent comes on mouse button release also?
Forum Updated to NodeBB v4.3 + New Features

QContextMenuEvent comes on mouse button release also?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.6k 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.
  • B Offline
    B Offline
    bootchk
    wrote on last edited by
    #1

    Can multiple QContextMenuEvent's can come from one button down, move, release?

    The documentation says when they come is platform dependent, but is a little fuzzy. For example, it says the event comes on RMB release on Windows (and for the Menu key.)

    Specifically, on OSX, I seem to be getting the event on RMB press. Then, if the app execs a menu, and the user moves the mouse outside the menu, then back into the menu and releases RMB, I seem to get another event. And worse, the action of the menu item does not get executed. (But I think that sequence should be allowed by HIG interface guidelines.)

    If the user keeps the mouse in the menu, the action is taken.

    The problem could be in my code. My code actually ignores QContextMenuEvent, and handles RMB press to exec the menu. But I still can see that I appear to be getting the event on RMB release. I will code up a small test case if I necessary.

    Am I making a mistake to handle RMB press? Since that doesn't follow interface guidelines on Windows? IOW, am I subverting the magic that Qt has done to shield me from this cross-platform issue?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bootchk
      wrote on last edited by
      #2

      I changed my code to handle contextMenuEvent instead of mousePressEvent (and exec a modal menu.)

      On OSX, a user choosing an item from context menu has no effect if the mouse has left the menu and returned before release. I think that is a Qt bug, although a very minor, harmless one. I don't seem to get another contextMenuEvent on RMB release (which is good.)

      On Windows Vista, the contextMenuEvent comes on mouse button down, unlike in native apps. Which I consider an undocumented deviation from the native interface guidelines, although a minor one, since a RMB click behaves as a user would expect (menu appears and stays open until clicked in again.

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

        Hi,

        You should bring the subject on the interest mailing list, you'll find there Qt's developers/maintainers (this forum is more user oriented)

        Your post and thus your findings will likely get buried and lost time passing by.

        You should also check the "bug report system":http://bugreports.qt-project.org to see whether someone already posted something about that

        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
        • B Offline
          B Offline
          bootchk
          wrote on last edited by
          #4

          I submitted a "bug":https://bugreports.qt-project.org/browse/QTBUG-37124

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

            Thanks for sharing !

            You should upload a sample program so other may test this

            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

            • Login

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