aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/doc/snippets/qtquickcontrols-itemdelegate.qml
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2024-04-04 10:13:36 +0800
committerMitch Curtis <mitch.curtis@qt.io>2024-06-12 08:17:26 +0800
commit7e3e1295f4e240afc9532bc0ab47ff3644ffc008 (patch)
treee4441dcebfc00c7faa3bebfe3f05edfd7e7d1e1e /src/quickcontrols/doc/snippets/qtquickcontrols-itemdelegate.qml
parentf673e8328c488fb337b69737d29a4846f2ec3eb7 (diff)
Doc: fix warning in ItemDelegate snippet
The error was: TypeError: Cannot read property 'width' of null Pick-to: 6.5 6.7 Change-Id: I0505e806130769fb7a2ed77b18c80393476edafd Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/quickcontrols/doc/snippets/qtquickcontrols-itemdelegate.qml')
-rw-r--r--src/quickcontrols/doc/snippets/qtquickcontrols-itemdelegate.qml3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quickcontrols/doc/snippets/qtquickcontrols-itemdelegate.qml b/src/quickcontrols/doc/snippets/qtquickcontrols-itemdelegate.qml
index 4d7fa30f22..33e9974094 100644
--- a/src/quickcontrols/doc/snippets/qtquickcontrols-itemdelegate.qml
+++ b/src/quickcontrols/doc/snippets/qtquickcontrols-itemdelegate.qml
@@ -6,6 +6,7 @@ import QtQuick.Controls
//! [1]
ListView {
+ id: listView
width: 160
height: 240
@@ -13,7 +14,7 @@ ListView {
delegate: ItemDelegate {
text: modelData
- width: parent.width
+ width: listView.width
onClicked: console.log("clicked:", modelData)
required property string modelData