Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.4, 6.6.1, 6.7.0 Beta1
-
95637da9a (dev), b89b83124 (6.7), 67311f932 (6.6), 76bb485d4 (tqtc/lts-6.5)
Description
Code
import QtQuick import QtQuick.Layouts import QtQuick.Controls.Basic ApplicationWindow { id: window width: 600 height: 300 visible: true palette: paletteButton.checked ? grayscalePalette : coloredPalette property color accentColor: Qt.color(Qt.hsla(slider_color.value, 0.5, 0.5)) Palette { id: grayscalePalette window: "white" windowText: "black" buttonText: "black" button: "lightgrey" text: "black" dark: "black" mid: "black" midlight: "black" light: "black" highlight: "black" highlightedText: "black" } Palette { id: coloredPalette window: "white" windowText: window.accentColor buttonText: window.accentColor button: "lightgrey" text: window.accentColor dark: window.accentColor mid: window.accentColor midlight: window.accentColor light: window.accentColor highlight: window.accentColor highlightedText: window.accentColor } GridLayout { anchors.fill: parent columns: 3 Label { text: "Palette" } Button { id: paletteButton checkable: true text: checked ? "Grayscale" : "Colored" } Item { Layout.fillWidth: true } Label { text: "Color" } Slider { id: slider_color } Rectangle { color: window.accentColor Layout.preferredWidth: 20 Layout.preferredHeight: 20 } } }
Outcomes
- When the "Color" slider is moved around, the little square changes color in real-time (Expected) but the controls always remain at the initial color (Not expected)
- If you click the "Palette" button twice, then the control colors now match the little square's color (until you change the slider value again)
Workaround
Manually force the palette to reload whenever the color changes:
onAccentColorChanged: { if (!paletteButton.checked) { paletteButton.checked = true paletteButton.checked = false } }
Attachments
For Gerrit Dashboard: QTBUG-121388 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
546345,5 | Update palette in quickwindow when binding palette changes | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
546975,2 | Update palette in quickwindow when binding palette changes | 6.7 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
547084,3 | Update palette in quickwindow when binding palette changes | 6.6 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
547232,2 | Update palette in quickwindow when binding palette changes | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |