From ee6a47ab3fc0dfcfb7301562b9b6dd5807d71079 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 9 Dec 2025 13:10:16 +0100 Subject: 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 Reviewed-by: Sami Shalayel --- tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 1 + 1 file changed, 1 insertion(+) (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 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 object(component.create()); QVERIFY(!object.isNull()); QCOMPARE(object->property("stringLength").toInt(), 8); + QCOMPARE(object->property("a"), u"astringb"_s); } void tst_QmlCppCodegen::stringToByteArray() -- cgit v1.2.3