Button Hover States
-
Hello!
I am having troubles with my Button hover state not resetting after it opens a new popup. Here is what I am doing:
Button { id: button hoverEnabled: true height: 26 width: 140 background: Rectangle { color: parent.hovered ? "red" : "green" } onClicked: { dialogWindow.open() } }
When I click the button and dialogWindow (popup) opens, it is in front of the dialog that contains my button with the button still visible. The button however stays the red color rather than reverting back to green. After some debugging it seems that my mouse is still being registered as inside the button when the new dialog opens. How do I fix this issue?
-
It's working as expected on both linux debian 12 & windows 11 with Qt6.8.0
I tried this code :import QtQuick import QtQuick.Controls Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Button { id: button hoverEnabled: true height: 26 width: 140 background: Rectangle { color: parent.hovered ? "red" : "green" } onClicked: { dialogWindow.open() } } Popup { id: dialogWindow x: 100 y: 100 width: 200 height: 300 modal: true focus: true closePolicy: Popup.CloseOnEscape } }