aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-09-30 09:23:20 +0200
committerUlf Hermann <ulf.hermann@qt.io>2022-10-06 20:37:53 +0200
commit1e712c95cee58ae242a93c029a7f79cf65b43882 (patch)
tree0a96614a2b62b75340628e02d7c282cf27647f67 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
parentb515099d4d7d90385a0258893ec949d4fba84b29 (diff)
QmlCompiler: Do not crash on version-mismatched property access
If we cannot access a property due to a version mismatch, that's not an unqualified access. Pick-to: 6.4 Fixes: QTBUG-107080 Change-Id: I1780b171928df437a2121601f1aac829dbe1e994 Reviewed-by: Semih Yavuz <semih.yavuz@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index 95a5340b75..011b496383 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -138,6 +138,7 @@ private slots:
void listPropertyAsModel();
void notNotString();
void mathOperations();
+ void inaccessibleProperty();
};
void tst_QmlCppCodegen::initTestCase()
@@ -2713,6 +2714,17 @@ void tst_QmlCppCodegen::mathOperations()
}
}
+void tst_QmlCppCodegen::inaccessibleProperty()
+{
+ QQmlEngine engine;
+
+ QQmlComponent c(&engine, QUrl(u"qrc:/qt/qml/TestTypes/versionmismatch.qml"_s));
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
+ QScopedPointer<QObject> o(c.create());
+
+ QCOMPARE(o->property("c").toInt(), 5);
+}
+
QTEST_MAIN(tst_QmlCppCodegen)
#include "tst_qmlcppcodegen.moc"