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

[REG] Sloppy submenus don't play nicely with QWidgetAction

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.6.1
    • 5.5.1, 5.6.0
    • Widgets: Main Window
    • None
    • Windows
    • eadd7e9cfb4e0802aa9da63badc41c39fec219bb

    Description

      Using Qt built from the 5.5 branch, I've noticed a few regressions that appear to have been introduced by the fix for QTBUG-20094. As mentioned in https://bugreports.qt.io/browse/QTBUG-20094?focusedCommentId=255104&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-255104, please assign this bug to Jorgen Lind.

      Since the regressions seem to be closely related, I've only created a single issue.

      You can use the attached project to reproduce both bugs.

      Bug1:

      On Macintosh, and in the QProxyStyle subclass contained in the attached project, QStyle::SH_Menu_SubMenuResetWhenReenteringParent is true.

      If I create a QMenu with a submenu, and if I create a QWidgetAction and add that action to the submenu, if I display the menu and then select the submenu and try to move the mouse cursor over to the QWidgetAction, as soon as the mouse cursor is over the QWidgetAction the submenu containing the QWidgetAction is closed.

      To see this, build the attached demo project. Click and release the tool button to display the menu. Then hover over the Select Color submenu. This displays a QWidgetAction containing a combo box. Move the mouse towards the combo box. The submenu containing the combo box disappears.

      Using the default style (with no proxy style), Bug 1 is only present on Macintosh. However if you use a proxy style to return true for QStyle::SH_Menu_SubMenuResetWhenReenteringParent, this bug is present on all platforms.

      The attached code uses a QProxyStyle to demonstrate the bug on all platforms.

      Bug 2:

      In order to reproduce Bug 2, you'll first need to uncomment line 10 in the attached main.cpp file, thus commenting out the

      #define WORK_AROUND_BUG_1 1;

      line.

      Click and release the tool button to display the menu. Move the mouse over the Select Color submenu. This will pop up the QWidgetAction containing a combo box. Now move the mouse diagonally towards the QComboBox, but make sure that the path of the mouse first goes outside of the main QMenu. I've attached a screenshot with a blue line showing the approximate path you need to take.

      After moving the mouse cursor over the QWidgetAction, wait for about a second, and the submenu containing the QWidgetAction will close.

      I am able to reproduce this about 80% of the time. Clearly there is something subtle that I'm sometimes doing that prevents the bug from happening.

      I suspect that I could work around this bug by having my proxy style return a large value for SH_Menu_SubMenuSloppyCloseTimeout, but I'm not sure what other consequences this will have.

      Bug 2 is present on both Macintosh and Windows.

      Attachments

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

        Activity

          People

            zaps166 Błażej Szczygieł
            aclight Adam Light
            Votes:
            2 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes