Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
6.5.3, 6.6.0
-
None
-
-
3ad1980ef (dev), f7ef1800a (6.6), 2431e7a91 (tqtc/lts-6.5)
Description
Sample code:
import QtQuick import QtQuick.Controls import Qt.labs.platform as Platform Window { width: 640 height: 480 visible: true Platform.Menu { id: trayMenu Platform.MenuItem { text: qsTr("Quit") onTriggered: Qt.quit() } } Platform.SystemTrayIcon { id: trayIcon visible: true icon.source: "https://img.icons8.com/emoji/96/teddy-bear-.png" menu: trayMenu } Button { text: trayIcon.menu ? 'Remove Tray Menu' : 'Set Tray Menu' onClicked: trayIcon.menu = trayIcon.menu ? null : trayMenu } }
Just launch it and click on tray icon (Teddy Bear ) - menu is displayed - OK
Press on 'Remove Tray Menu' button and click on tray icon again - menu is still displayed - BUG.
Continue clicking on 'Set Tray Menu'/ 'Remove Tray Menu' and observe tray icon menu behaviour, you'll find it completely unpredictable. Also in the debug output there are warnings, such as
qt.qpa.menus: Menu item "Quit" already in menu "" qt.qpa.menus: Menu item "Quit" already in menu "Untitled" qt.qpa.menus: Menu item "Quit" already in menu "Untitled" ...
Attachments
Issue Links
- relates to
-
QTBUG-119068 QSystemTrayIcon - unable to reset context menu
- Closed