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.
|For Gerrit Dashboard: QTBUG-46293|
|146951,15||dbusmenu: Refactor the code to allow dynamic updating of menus||5.6||qt/qtbase||Status: MERGED||+2||0|