aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/snippets/qmltc/special/HelloWorld.qml
blob: ca2a4bc015bd79f34a74d85bf4083f2d452807e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

//! [qmltc-hello-world-qml]
// HelloWorld.qml
import QtQml

QtObject {
    id: me
    property string hello: "Hello, qmltc!"

    function printHello(prefix: string, suffix: string) {
        console.log(prefix + me.hello + suffix);
    }

    signal created()
    Component.onCompleted: me.created();
}
//! [qmltc-hello-world-qml]