diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2024-03-25 11:26:46 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2024-03-26 12:31:58 +0100 |
| commit | f47df45b4981d2d3eedfdbcf7574a7d2e2625627 (patch) | |
| tree | af44aa5e906877225f164d50f7c05bc0a14ec7aa /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | e3b1d3532b1f33bb8e8e6435df8b159e04c34068 (diff) | |
QmlCompiler: Fix code for object literal generation
We have to use the arguments as base for the run time calculated
members, not the argument count.
Amends commit f839171eefbba670536262fa3b847d24bfdc627b.
Pick-to: 6.7
Fixes: QTBUG-123613
Change-Id: I3ddc8bc459618bd9a9436d3616c444bf218463a3
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
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.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 475cb8eee6..82cc1fe954 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -4937,6 +4937,14 @@ void tst_QmlCppCodegen::variantMap() QCOMPARE(o->objectName(), "a b"_L1); QCOMPARE(o->property("r"), QVariant::fromValue(QRectF(12, 13, 14, 15))); + + const QVariantMap expected = QVariantMap { + { u"1"_s, QVariant::fromValue<std::nullptr_t>(nullptr) }, + { u"19"_s, QVariant::fromValue(u"19"_s) }, + { u"25"_s, QVariant() } + }; + + QCOMPARE(o->property("v").toMap(), expected); } void tst_QmlCppCodegen::voidConversion() |
