aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
authorOlivier De Cannière <olivier.decanniere@qt.io>2025-03-05 11:41:23 +0100
committerOlivier De Cannière <olivier.decanniere@qt.io>2025-03-06 19:23:04 +0100
commit2cc30828af4ffe6d9cc0c6c91d3b665366a03f81 (patch)
treeabda558a1f928c34ba9d10052adfc1901a078774 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
parent321a05e10bb0d1548f49f8dd077cae41ca490e44 (diff)
QML: Add final property attribute
This works the same as the FINAL attribute to Q_PROPERTY. Task-number: QTBUG-98320 Change-Id: Icc2cf1afb5354fd711770f7147ded853b74cd1da Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index e023d705d9..9ac9898ed0 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -118,6 +118,7 @@ private slots:
void failures();
void fallbackLookups();
void fileImportsContainCxxTypes();
+ void finalProperty();
void flagEnum();
void flushBeforeCapture();
void fromBoolValue();
@@ -2120,6 +2121,16 @@ void tst_QmlCppCodegen::fileImportsContainCxxTypes()
QCOMPARE(o->objectName(), u"horst guenther"_s);
}
+void tst_QmlCppCodegen::finalProperty()
+{
+ QQmlEngine e;
+ QQmlComponent c(&e, QUrl(u"qrc:/qt/qml/TestTypes/finalUser.qml"_s));
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
+ QScopedPointer<QObject> o(c.create());
+ QVERIFY(!o.isNull());
+ QCOMPARE(o->property("f").toInt(), 12);
+}
+
void tst_QmlCppCodegen::flagEnum()
{
QQmlEngine engine;