aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml/tutorials/extending-qml/chapter3-bindings
diff options
context:
space:
mode:
authorSemih Yavuz <semih.yavuz@qt.io>2022-11-07 11:28:37 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-11-09 19:14:39 +0000
commitbab27113de433f75adef03713bc7fc76f7938804 (patch)
tree57c92de4224c99e83ad307463e37dd83f2276982 /examples/qml/tutorials/extending-qml/chapter3-bindings
parent0aa2b2641d00e3e7afed66dd1abab6667b445da6 (diff)
QmlExamples: Add missing dependencies of QtQuick in CMakeLists
Running qmllint on extending-qml examples raises a plenty of warnings due to a missing dependency declaration to QtQuick. Simply add it. Also add FINAL to all properties exposed from C++ to disable (possible) property shadowings. Fixes: QTBUG-106602 Change-Id: I7b12a804f8f3ca64bd8f2f312a9e53dfe02b0a4c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 826cf9bb808999d9b49f8ad53b80a902e8fd7bda) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/qml/tutorials/extending-qml/chapter3-bindings')
-rw-r--r--examples/qml/tutorials/extending-qml/chapter3-bindings/CMakeLists.txt1
-rw-r--r--examples/qml/tutorials/extending-qml/chapter3-bindings/piechart.h4
2 files changed, 3 insertions, 2 deletions
diff --git a/examples/qml/tutorials/extending-qml/chapter3-bindings/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter3-bindings/CMakeLists.txt
index f600ae5389..184f440c1d 100644
--- a/examples/qml/tutorials/extending-qml/chapter3-bindings/CMakeLists.txt
+++ b/examples/qml/tutorials/extending-qml/chapter3-bindings/CMakeLists.txt
@@ -40,6 +40,7 @@ qt_add_qml_module(chapter3-bindings
VERSION 1.0
QML_FILES app.qml
NO_RESOURCE_TARGET_PATH
+ DEPENDENCIES QtQuick
)
install(TARGETS chapter3-bindings
diff --git a/examples/qml/tutorials/extending-qml/chapter3-bindings/piechart.h b/examples/qml/tutorials/extending-qml/chapter3-bindings/piechart.h
index 58b1339298..ef3f6a79dc 100644
--- a/examples/qml/tutorials/extending-qml/chapter3-bindings/piechart.h
+++ b/examples/qml/tutorials/extending-qml/chapter3-bindings/piechart.h
@@ -58,11 +58,11 @@ class PieChart : public QQuickPaintedItem
{
//![0]
Q_OBJECT
- Q_PROPERTY(QString name READ name WRITE setName)
+ Q_PROPERTY(QString name READ name WRITE setName FINAL)
QML_ELEMENT
//![1]
- Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
+ Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged FINAL)
public:
//![1]