From 70af90d85bc1cab45988b2b5610919806be7fc49 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 21 Feb 2024 21:57:23 +0100 Subject: 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 --- examples/demos/colorpaletteclient/ColorPalette/ColorView.qml | 2 +- examples/demos/colorpaletteclient/ColorPalette/UserMenu.qml | 4 +++- 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 -- cgit v1.2.3