diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-04-28 16:46:23 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-05-02 16:44:37 +0200 |
| commit | 9e0da8e0288d4c87eaa6f8a22ec107e04d0cd305 (patch) | |
| tree | 3cde2b2b667ebd58002a19894440c47cee0cdc8e /examples/qml/tutorials/extending-qml/chapter2-methods/app.qml | |
| parent | fbb22873530c200b4ddb9b2da91764948bb9da71 (diff) | |
Move the QML reference examples around to match the structure in Qt
Adapt the tests accordingly.
Task-number: PYSIDE-2206
Task-number: QTBUG-111033
Pick-to: 6.5
Change-Id: I332d6467da56b88ecbf9282d23092d8d47b730e0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'examples/qml/tutorials/extending-qml/chapter2-methods/app.qml')
| -rw-r--r-- | examples/qml/tutorials/extending-qml/chapter2-methods/app.qml | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/examples/qml/tutorials/extending-qml/chapter2-methods/app.qml b/examples/qml/tutorials/extending-qml/chapter2-methods/app.qml new file mode 100644 index 000000000..d330f3b64 --- /dev/null +++ b/examples/qml/tutorials/extending-qml/chapter2-methods/app.qml @@ -0,0 +1,33 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +//![0] +import Charts +import QtQuick + +Item { + width: 300; height: 200 + + PieChart { + id: aPieChart + anchors.centerIn: parent + width: 100; height: 100 + color: "red" + + onChartCleared: console.log("The chart has been cleared") + } + + MouseArea { + anchors.fill: parent + onClicked: aPieChart.clearChart() + } + + Text { + anchors { + bottom: parent.bottom; + horizontalCenter: parent.horizontalCenter; + bottomMargin: 20 + } + text: "Click anywhere to clear the chart" + } +} +//![0] |
