diff options
Diffstat (limited to 'src/qml/doc/snippets/qml/exposing-state/RequiredProperties.qml')
-rw-r--r-- | src/qml/doc/snippets/qml/exposing-state/RequiredProperties.qml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/qml/doc/snippets/qml/exposing-state/RequiredProperties.qml b/src/qml/doc/snippets/qml/exposing-state/RequiredProperties.qml new file mode 100644 index 0000000000..18425930de --- /dev/null +++ b/src/qml/doc/snippets/qml/exposing-state/RequiredProperties.qml @@ -0,0 +1,23 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +//![0] +pragma ComponentBehavior: Bound + +import QtQuick + +Window { + id: root + visible: true + + required property int thing + + Text { + anchors.fill: parent + text: "The thing is " + root.thing + } + + component Inner: QtObject { + objectName: "I can see " + root.thing + " because I'm bound." + } +} +//![0] |