aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/doc/snippets/qml/qml-extending-types/methods/app.qml
blob: f5b7714c1aacb734be43f52166e9fe588b491915 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
import QtQuick
//![0]
Rectangle {
    id: rect
    width: 100; height: 100

    function say(text) {
        console.log("You said: " + text);
    }

    MouseArea {
        anchors.fill: parent
        onClicked: rect.say("Mouse clicked")
    }
}
//![0]