Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.3.0 Beta2
-
None
-
-
c135dbf522 (qt/qtdeclarative/6.4) 2483ffa011 (qt/qtdeclarative/dev) c135dbf522 (qt/tqtc-qtdeclarative/6.4) 2483ffa011 (qt/tqtc-qtdeclarative/dev)
Description
In the follows code, when i clicked the button, it's background is not change, but it should follow the left Rectangle to change to blue.
import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.0 ApplicationWindow { id: window width: 640 height: 480 visible: true title: qsTr("Hello World") palette { window: "white" windowText: "red" } Row { anchors.centerIn: parent spacing: 10 Rectangle { width: 100 height: 100 color: window.palette.windowText Text { anchors.centerIn: parent text: "Window" color: "white" } } Button { width: 100 height: 100 enabled: false text: "Button" palette.window: "yellow" background: Rectangle { color: parent.palette.windowText } Timer { id: updateTheControlPalette interval: 500 running: true onTriggered: { // If set the palette of the Button in there, then it's "windowText" // color will can't follow the window's palette parent.palette.window = "red" parent.enabled = true } } onClicked: { window.palette.windowText = "blue" } } } }