aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2025-10-06 10:09:01 +0200
committerUlf Hermann <ulf.hermann@qt.io>2025-10-07 07:41:21 +0200
commitf5e34266ea15c6e44e9816f01f4e627d5f038f0c (patch)
tree4e898b2d1f37f8c19602ed6e4381bb6b30989121 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
parentba56f1e4638f9752903d587129b0474e845ce416 (diff)
QmlCompiler: Fix write access to QVariantMap
Without this, it tries to resolve the metaObject of QVariantMap, which crashes. Amends commit cca07aa78841f2d743f0b4d933abb0dd66f0b948. Fixes: QTBUG-139626 Pick-to: 6.10 6.8 Change-Id: Id747429ed0d558932b9a6cb8f59e3740982efb56 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index 884372bfa4..016d4c95a0 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -6126,6 +6126,12 @@ void tst_QmlCppCodegen::variantMapLookup()
QVERIFY(!o.isNull());
QCOMPARE(o->property("i"), 42);
QCOMPARE(o->property("j"), 42);
+ QCOMPARE(o->property("foo"), u"blue"_s);
+
+ QMetaObject::invokeMethod(o.data(), "doI");
+ QCOMPARE(o->property("i"), 43);
+ QCOMPARE(o->property("j"), 43);
+ QCOMPARE(o->property("foo"), u"blue"_s);
}
void tst_QmlCppCodegen::variantReturn()