aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/snippets/qml/integrating-javascript/scarceresources/exampleOne.qml
blob: 9d52e0fe40ad337e99317956f1cb337bdc084a5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
// exampleOne.qml
import QtQuick 2.0
import Qt.example 1.0

QtObject {
    property AvatarExample a;
    a: AvatarExample { id: example }
    property var avatarWidth: example.avatar,100
    // Here, we use "example.avatar,100" purely for illustration.
    // The value of `avatarWidth' will be 100 after evaluation.
    // E.g., you could imagine some js function which takes
    // an avatar, and returns the width of the avatar.
}
//![0]