From 826cf9bb808999d9b49f8ad53b80a902e8fd7bda Mon Sep 17 00:00:00 2001 From: Semih Yavuz Date: Mon, 7 Nov 2022 11:28:37 +0100 Subject: 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. Pick-to: 6.4 6.2 Fixes: QTBUG-106602 Change-Id: I7b12a804f8f3ca64bd8f2f312a9e53dfe02b0a4c Reviewed-by: Fabian Kosmale --- examples/qml/tutorials/extending-qml/chapter1-basics/CMakeLists.txt | 1 + examples/qml/tutorials/extending-qml/chapter1-basics/piechart.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'examples/qml/tutorials/extending-qml/chapter1-basics') diff --git a/examples/qml/tutorials/extending-qml/chapter1-basics/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter1-basics/CMakeLists.txt index 7b6db0a6d3..ba2851b98d 100644 --- a/examples/qml/tutorials/extending-qml/chapter1-basics/CMakeLists.txt +++ b/examples/qml/tutorials/extending-qml/chapter1-basics/CMakeLists.txt @@ -36,6 +36,7 @@ qt_add_qml_module(chapter1-basics VERSION 1.0 QML_FILES app.qml NO_RESOURCE_TARGET_PATH + DEPENDENCIES QtQuick ) #![0] install(TARGETS chapter1-basics diff --git a/examples/qml/tutorials/extending-qml/chapter1-basics/piechart.h b/examples/qml/tutorials/extending-qml/chapter1-basics/piechart.h index 6b39295e8d..a438cafbfb 100644 --- a/examples/qml/tutorials/extending-qml/chapter1-basics/piechart.h +++ b/examples/qml/tutorials/extending-qml/chapter1-basics/piechart.h @@ -10,8 +10,8 @@ class PieChart : public QQuickPaintedItem { Q_OBJECT - Q_PROPERTY(QString name READ name WRITE setName) - Q_PROPERTY(QColor color READ color WRITE setColor) + Q_PROPERTY(QString name READ name WRITE setName FINAL) + Q_PROPERTY(QColor color READ color WRITE setColor FINAL) QML_ELEMENT public: -- cgit v1.2.3