Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-31937

Drag-selecting menu item does not work on Mac

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.5.0
    • 5.1.0 Beta 1
    • None
    • Mac OS X
    • macOS
    • 10126b37d2e4655e17a2ea25b10801d8f9186f1c

    Description

      QMenu doesn't emit triggered() signal if the menu item is selected by dragging the mouse cursor over it.

      This can be tested with a QToolButton by pressing the left mouse button down on it, dragging the mouse cursor over a menu item and then releasing the mouse button.

      Note that selection works if the QToolButton is clicked, the mouse cursor is moved (not dragged) over the menu item and the mouse is clicked again. Also, selection works always if the menu item is outside the main window.

      This happens also when drag-selecting context popup menus. However, it happens only if the mouse cursor is first moved outside the menu and then back in. The console also displays error message:
      QNSView mouseDragged: Internal mouse button tracking invalid (missing Qt::LeftButton)

      The attached example can be used to test both cases. In the pictures, the red area indicates where drag-selection doesn't work, while the green area indicates where it works (outside the main window).

      Selection works in all cases in Qt 4.7.4 on Mac, but doesn't work anymore in Qt 5.1.0 beta on Mac.

      Attachments

        1. contextmenu.png
          contextmenu.png
          24 kB
        2. qt5menu.zip
          2 kB
        3. qtoolbar-menu.png
          qtoolbar-menu.png
          17 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              sorvig Morten Sørvig
              kpihkala Kari Pihkala
              Votes:
              17 Vote for this issue
              Watchers:
              24 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes