diff options
author | Semih Yavuz <semih.yavuz@qt.io> | 2022-11-07 11:28:37 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-11-09 19:14:29 +0000 |
commit | a355c9aa330aade309fc88bb1daabd3c53fc7a87 (patch) | |
tree | 4bb14ffe8871f4a5f39451c84ac6ebcc9122c021 /examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes | |
parent | da4905875518f58c948c847c6218b1c3089d7acd (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/chapter4-customPropertyTypes')
3 files changed, 4 insertions, 3 deletions
diff --git a/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/CMakeLists.txt index eeddbcfc14..c7263d103b 100644 --- a/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/CMakeLists.txt +++ b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/CMakeLists.txt @@ -34,6 +34,7 @@ qt_add_qml_module(chapter4-customPropertyTypes VERSION 1.0 QML_FILES app.qml NO_RESOURCE_TARGET_PATH + DEPENDENCIES QtQuick ) #![1] install(TARGETS chapter4-customPropertyTypes diff --git a/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/piechart.h b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/piechart.h index e684d9c7e8..0c4088435f 100644 --- a/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/piechart.h +++ b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/piechart.h @@ -11,9 +11,9 @@ class PieSlice; class PieChart : public QQuickItem { Q_OBJECT - Q_PROPERTY(PieSlice* pieSlice READ pieSlice WRITE setPieSlice) + Q_PROPERTY(PieSlice* pieSlice READ pieSlice WRITE setPieSlice FINAL) //![0] - Q_PROPERTY(QString name READ name WRITE setName) + Q_PROPERTY(QString name READ name WRITE setName FINAL) Q_MOC_INCLUDE("pieslice.h") QML_ELEMENT //![1] diff --git a/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/pieslice.h b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/pieslice.h index d291272eaf..74c6149e85 100644 --- a/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/pieslice.h +++ b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/pieslice.h @@ -10,7 +10,7 @@ class PieSlice : public QQuickPaintedItem { Q_OBJECT - Q_PROPERTY(QColor color READ color WRITE setColor) + Q_PROPERTY(QColor color READ color WRITE setColor FINAL) QML_ELEMENT public: |