diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2024-12-09 09:51:28 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2024-12-12 18:20:55 +0100 |
| commit | 94a481d433284b3c22df997c540513cb868c8dc6 (patch) | |
| tree | c1044e7cf2c7d68ff9243e5cbfc084175e4e7523 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | 953c38b5818231d52ea170eb6466296f94473c76 (diff) | |
QmlCompiler: Use correct static_metacall on DefineObjectLiteral
When constructing a value type, we cannot just assume that the
most-derived type holds all the properties. We may encounter properties
from base types. Resolve those via QMetaProperty.
Pick-to: 6.9 6.8
Fixes: QTBUG-131980
Change-Id: I8e1773ccb42f86b96457c990ae5bc6486ae1acdc
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 | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 5ed4eb8d0c..58bbfa751f 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -4900,8 +4900,13 @@ void tst_QmlCppCodegen::structuredValueType() QCOMPARE(o->property("w").value<WeatherModelUrl>(), w); - w.setStrings(QStringList({u"three"_s, u"two"_s, u"one"_s})); - QCOMPARE(o->property("w2").value<WeatherModelUrl>(), w); + WeatherModelUrlDerived w1; + w1.setStrings(QStringList({u"four"_s, u"five"_s, u"six"_s})); + QCOMPARE(o->property("w1").value<WeatherModelUrlDerived>(), w1); + + WeatherModelUrl w2; + w2.setStrings(QStringList({u"three"_s, u"two"_s, u"one"_s})); + QCOMPARE(o->property("w2").value<WeatherModelUrl>(), w2); } void tst_QmlCppCodegen::testIsnan() |
