diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2025-12-09 13:10:16 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2025-12-10 20:16:35 +0100 |
| commit | ee6a47ab3fc0dfcfb7301562b9b6dd5807d71079 (patch) | |
| tree | 5d091374b19edc643796a8532a64c1823cd21b84 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | 95ede80c64b87e2fbb69d36a77ac346a6a4631b7 (diff) | |
QmlCompiler: Get length from strings wrapped in QJSPrimitiveValue
We need to consider the original type of the value in order to see what
we can do with it and we need to convert it (back) to string where
necessary.
Pick-to: 6.11 6.10
Fixes: QTBUG-142550
Change-Id: Ic0eb2c7a22636cfb2d97297421b911555bd32bb1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 98830fc33d..c053f4b09f 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -5734,6 +5734,7 @@ void tst_QmlCppCodegen::stringLength() QScopedPointer<QObject> object(component.create()); QVERIFY(!object.isNull()); QCOMPARE(object->property("stringLength").toInt(), 8); + QCOMPARE(object->property("a"), u"astringb"_s); } void tst_QmlCppCodegen::stringToByteArray() |
