Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.12.2, 5.12.3, 5.12.4, 5.13.0
-
None
-
-
66de71b26a6c3b5be308c1a92287b6490164ae72 (qt/qtquickcontrols2/5.13)
Description
When I use `MenuBar.addMenu` to add a dynamically created `Menu`, the `MenuBarItem` does not lose highlight when the `Menu` is dismissed. Here's an example:
import QtQuick 2.12 import QtQuick.Controls 2.12 ApplicationWindow { id: window width: 300 height: 300 visible: true Component.onCompleted: mb.addMenu(cmp.createObject(mb)) menuBar: MenuBar { id: mb width: parent.width Menu { title: "This Works" MenuItem { text: "Cut" } MenuItem { text: "Copy" } MenuItem { text: "Paste" } } } Component { id: cmp Menu { title: "This Doesn't" MenuItem { text: "Cut" } MenuItem { text: "Copy" } MenuItem { text: "Paste" } } } }
When you click on the static menu titled "This Works", it will lose highlight when mouse is clicked on the menu items or outside, but doing the same on the dynamically added menu won't work.