aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-04-05 11:39:20 +0200
committerUlf Hermann <ulf.hermann@qt.io>2022-04-06 17:12:41 +0200
commita55299615ffbc50a2f0f0070015ed40e3b3dcca2 (patch)
treebd2a3973530b663c81affb9f630a1df0dc0cc19a /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
parente0e4cfca957c0451bdcde380b1bc6d9355bca340 (diff)
QmlCompiler: Fix string-to-bool conversion via QJSPrimitiveValue
We had a typo in there. Pick-to: 6.2 6.3 Fixes: QTBUG-102309 Change-Id: I11eb9d35fde3b92d2e48e845740379e10c53774a 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.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index fad99c3a5a..300aae66ef 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -1998,6 +1998,15 @@ void tst_QmlCppCodegen::fromBoolValue()
QCOMPARE(o->property("a").toBool(), true);
o->setProperty("x", 100);
QCOMPARE(o->property("a").toBool(), false);
+
+ QCOMPARE(o->property("width").toInt(), 100);
+
+ QScopedPointer<QObject> parent(c.create());
+ o->setProperty("parent", QVariant::fromValue(parent.data()));
+ QCOMPARE(o->property("width").toInt(), 100);
+
+ o->setProperty("state", QVariant::fromValue(u"foo"_qs));
+ QCOMPARE(o->property("width").toInt(), 0);
}
void tst_QmlCppCodegen::runInterpreted()