summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-02-21 21:57:23 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2024-02-22 12:05:13 +0100
commit70af90d85bc1cab45988b2b5610919806be7fc49 (patch)
tree43fac794cb2d664a0678a5d18348ac8aa676fea3
parentddab1eeb4812589cda605b1595bf1e9ad2d349de (diff)
color palette example: Fix errors in Python port
The Python port uses different models, which causes QML errors like ColorPalette/ColorView.qml:296:17: TypeError: Cannot read property 'width' of null when refreshing the model. Specify ids instead of "parent" in the delegates since their parent can arbitrarily change. Amends 7a62659880d5cc56316ccf1129e2c694bb138bd7 Task-number: QTBUG-115085 Pick-to: 6.7 Change-Id: Ic7097496ad2d8b902225ea0e5c3a661f797aed16 Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
-rw-r--r--examples/demos/colorpaletteclient/ColorPalette/ColorView.qml2
-rw-r--r--examples/demos/colorpaletteclient/ColorPalette/UserMenu.qml4
2 files changed, 4 insertions, 2 deletions
diff --git a/examples/demos/colorpaletteclient/ColorPalette/ColorView.qml b/examples/demos/colorpaletteclient/ColorPalette/ColorView.qml
index b16d70134..4563c7899 100644
--- a/examples/demos/colorpaletteclient/ColorPalette/ColorView.qml
+++ b/examples/demos/colorpaletteclient/ColorPalette/ColorView.qml
@@ -293,7 +293,7 @@ Item {
required property var modelData
- width: parent.width
+ width: colorListView.width
height: 25
RowLayout {
anchors.fill: parent
diff --git a/examples/demos/colorpaletteclient/ColorPalette/UserMenu.qml b/examples/demos/colorpaletteclient/ColorPalette/UserMenu.qml
index 1f279cce1..c4750ef72 100644
--- a/examples/demos/colorpaletteclient/ColorPalette/UserMenu.qml
+++ b/examples/demos/colorpaletteclient/ColorPalette/UserMenu.qml
@@ -24,6 +24,8 @@ Popup {
anchors.fill: parent
ListView {
+ id: userListView
+
model: userMenu.userMenuUsers.data
spacing: 5
footerPositioning: ListView.PullBackFooter
@@ -36,7 +38,7 @@ Popup {
id: userInfo
height: 30
- width: parent.width
+ width: userListView.width
required property var modelData