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" } } } }
Attachments
For Gerrit Dashboard: QTBUG-101480 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
399320,28 | Let Controls inherit palettes and fonts from parents | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
420503,1 | Make QQuickControl inherit the palette and font from parent | tqtc/lts-5.15 | qt/tqtc-qtquickcontrols2 | Status: ABANDONED | +1 | 0 |
421041,2 | Let Controls inherit palettes and fonts from parents | 6.4 | qt/qtdeclarative | Status: MERGED | +2 | 0 |