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

REG: QMenu and QSystemTrayIcon/DBusTray: Context menu doesn't refresh submenus correctly, possible crash is some cases

    XMLWordPrintable

Details

    • 7ef8f9310e069ea2966e2df559151322d421b1b9

    Description

      This bug is related to QTBUG-45803. I noticed that sub-menus in new DBusTray are not refreshed correctly and signals from QMenu are not emitted (aboutToShow, aboutToHide, hovered). In attachment there is simple test application. In the test application there is tray with menu, and QMainWindow with the same menu. Menu in the MainWindow works correctly, but in tray (DBusTray) works bad. Items in main menu (not in sub-menu) seems to work OK.

      Steps to reproduce:

      • open the application from console (to see stderr),
      • right click on tray icon - the QMenu::aboutToShow signal is not emitted, so SubMenu1 is empty (it creates after QMenu::aboutToShow signal),
      • click on "Menu" in MainWindow - the QMenu::aboutToShow signal is emitted, so SubMenu1 is created,
      • click on "Menu/SubMenu1/SubMenuItem1" - the item is checked,
      • open menu from tray and as you can see - "SubMenuItem1" is also checked,
      • click on "Menu/SubMenu1/SubMenuItem1" again from MainWindow - the item is not checked,
      • open menu from tray and as you can see - "SubMenuItem1" is still checked!,
      • click on "SubMenuItem2" from tray menu - there is a crash!
      • reopen the application,
      • right click on tray icon, go to "SubMenu2" and click on "Text 1" - the text should change and the icon should appear,
      • then look at this item in from MainWindow - everything is OK, but from tray - not OK,
      • in main menu (not sub-menu) there is the same test as in "SubMenu2" - it works correctly.

      Notice, that "triggered" signal is not emitted from sub menus and "hovered" signal is not emitted from system tray menu.

      There is another regression: "hovered" signal is emitted from menu in MainWindow on every mouse move, but in Qt 5.4.1 is emitted only once.

      And the last regression: click on the "Menu" in MainWindow then click again to hide it, and click again to show it again - it will not show. You must click once again.

      Attachments

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              zaps166 Błażej Szczygieł
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes