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/chapter6-plugins | |
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/chapter6-plugins')
3 files changed, 6 insertions, 5 deletions
diff --git a/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/CMakeLists.txt index 324bcbe27c..da4c649864 100644 --- a/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/CMakeLists.txt +++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/CMakeLists.txt @@ -2,6 +2,7 @@ qt6_add_qml_module(chartsplugin VERSION 1.0 URI "Charts" PLUGIN_TARGET chartsplugin + DEPENDENCIES QtQuick ) target_sources(chartsplugin PRIVATE diff --git a/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/piechart.h b/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/piechart.h index 2c50be16cf..6c771e9814 100644 --- a/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/piechart.h +++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/piechart.h @@ -10,8 +10,8 @@ class PieSlice; class PieChart : public QQuickItem { Q_OBJECT - Q_PROPERTY(QQmlListProperty<PieSlice> slices READ slices) - Q_PROPERTY(QString name READ name WRITE setName) + Q_PROPERTY(QQmlListProperty<PieSlice> slices READ slices FINAL) + Q_PROPERTY(QString name READ name WRITE setName FINAL) QML_ELEMENT public: diff --git a/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/pieslice.h b/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/pieslice.h index a8987f00fc..b07773c29f 100644 --- a/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/pieslice.h +++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/pieslice.h @@ -9,9 +9,9 @@ class PieSlice : public QQuickPaintedItem { Q_OBJECT - Q_PROPERTY(QColor color READ color WRITE setColor) - Q_PROPERTY(int fromAngle READ fromAngle WRITE setFromAngle) - Q_PROPERTY(int angleSpan READ angleSpan WRITE setAngleSpan) + Q_PROPERTY(QColor color READ color WRITE setColor FINAL) + Q_PROPERTY(int fromAngle READ fromAngle WRITE setFromAngle FINAL) + Q_PROPERTY(int angleSpan READ angleSpan WRITE setAngleSpan FINAL) QML_ELEMENT public: |