Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
5.11.2
-
None
-
Windows 10 x64, Intel platform, in-built UHD graphics.
Description
If you control a MenuItem's checked state using the checked property it can be overridden by clicking on the menu item.
The example below can be added to an empty QML project or just viewed using qmlscene.exe.
The expected behaviour is that only one menu item is ticked at a time.
If you click on the "Reset Mode" item whilst the "Mode 0" menu item is checked they will both end up being checked. This is the simplest example I could produce.
import QtQuick 2.11 import QtQuick.Window 2.11 import QtQuick.Controls 2.4 Window { visible: true width: 640 height: 480 title: qsTr("Hello World") property int mode: 0 MenuBar { Menu { title: "Mode" MenuItem { text: "Mode 0" checkable: true checked: 0 == mode onTriggered: { mode = mode + 1; } } MenuItem { text: "Reset Mode" checkable: true checked: 0 != mode onTriggered: { mode = 0; } } } } }