macOS window list in the dock icon menu.
-
Hi all.
We recently ported our application from Qt 5 to Qt 6, and noticed the following on the macOS version: the application's dock icon menu now includes the list of windows. which was not displayed with Qt 5.
Now the problem is that we have a QSystemTrayIcon in our application, and it creates this ugly "Item-0" entry in the window list.
Is there a way to:
- get rid of the window list in the dock menu (qt 5 style) ?
- get rid of the
Item-0
entry alone?
This seems unrelated to any menu we set via
QMenu::setAsDockMenu()
.Here is a minimal example showing the issue. The code compiles both on Qt 5 and 6, and the window list only appears in the Qt 6 version.
Thanks!
Xavier
-
I have faced a similar problem for some time. Decided to experiment with Loaders and loading SystemTrayIcon asynchronously.
Surprisingly this solved "Item-0" issue for me.ApplicationWindow { id: root ... visible: true Component { id: trayComponent SystemTrayIcon { id: systemIcon } } Loader{ sourceComponent: trayComponent asynchronous: true visible: status == Loader.Ready }
-
Hi,
I also encounter this issue and I solved it by delaying the show:
QTimer::singleShot(250, this, [this] { trayIcon.show(); });