aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick
diff options
context:
space:
mode:
authorSami Varanka <sami.varanka@qt.io>2022-10-17 20:14:55 +0300
committerSami Varanka <sami.varanka@qt.io>2022-10-19 06:59:22 +0000
commit7af1f664ac22d82d367d9fee9b6903242bf986ac (patch)
tree14b7bc059eb566ea83c3b00c1bda4c2236f0d1de /examples/quick
parent52659c494d89f2b9f301cec37e5435d381f7ccd3 (diff)
Fix TypeError in dynamicview1 example
Rectangle's parent was null when setting left and right anchors. Use pragma ComponentBehavior: Bound and required properties instead. Pick-to: 6.4 Fixes: QTBUG-106645 Change-Id: Ie5b8c3a20948799363fad1332113884612d18968 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'examples/quick')
-rw-r--r--examples/quick/tutorials/dynamicview/dynamicview1/dynamicview.qml8
1 files changed, 7 insertions, 1 deletions
diff --git a/examples/quick/tutorials/dynamicview/dynamicview1/dynamicview.qml b/examples/quick/tutorials/dynamicview/dynamicview1/dynamicview.qml
index e3d3544103..ec776d4153 100644
--- a/examples/quick/tutorials/dynamicview/dynamicview1/dynamicview.qml
+++ b/examples/quick/tutorials/dynamicview/dynamicview1/dynamicview.qml
@@ -1,6 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+pragma ComponentBehavior: Bound
//![0]
import QtQuick
@@ -16,7 +17,12 @@ Rectangle {
Rectangle {
id: content
- anchors { left: parent.left; right: parent.right }
+ required property string name
+ required property string type
+ required property string size
+ required property int age
+
+ width: view.width
height: column.implicitHeight + 4
border.width: 1