From f5e34266ea15c6e44e9816f01f4e627d5f038f0c Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 6 Oct 2025 10:09:01 +0200 Subject: QmlCompiler: Fix write access to QVariantMap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp') 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() -- cgit v1.2.3