diff options
author | Sami Varanka <[email protected]> | 2022-10-17 20:14:55 +0300 |
---|---|---|
committer | Sami Varanka <[email protected]> | 2022-10-19 06:59:22 +0000 |
commit | 7af1f664ac22d82d367d9fee9b6903242bf986ac (patch) | |
tree | 14b7bc059eb566ea83c3b00c1bda4c2236f0d1de /examples/quick/tutorials | |
parent | 52659c494d89f2b9f301cec37e5435d381f7ccd3 (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 <[email protected]>
Diffstat (limited to 'examples/quick/tutorials')
-rw-r--r-- | examples/quick/tutorials/dynamicview/dynamicview1/dynamicview.qml | 8 |
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 |