diff options
| author | Olivier De Cannière <olivier.decanniere@qt.io> | 2025-04-14 10:39:24 +0200 |
|---|---|---|
| committer | Olivier De Cannière <olivier.decanniere@qt.io> | 2025-04-17 12:10:22 +0200 |
| commit | b5e586f98444e8f83647b5a1451c4e7537b1d0ec (patch) | |
| tree | 23100aa8fe86b9e018c1fa828544cea0b2d82f1c /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | 96f4e60ffe43d8d387b2ef0002a421edd5d06239 (diff) | |
Compiler: Skip bindings to properties of type QQmlScriptString
There is nothing to do in the compiler.
Setting the value of the property is already handled in by the object
creator or the qobjectwrapper.
Reading the value doesn't really makes sense and defeats its purpose .
Fixes: QTBUG-134790
Pick-to: 6.9 6.8
Change-Id: I4576eb528e0dec273830b0244149a92ceb325bc9
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 | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index b2bc02399f..81c68057ee 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -61,6 +61,7 @@ private slots: void basicDTZ(); void bindToValueType(); void bindingExpression(); + void bindingToScriptStringProperty(); void blockComments(); void boolCoercions(); void boolPointerMerge(); @@ -952,6 +953,20 @@ void tst_QmlCppCodegen::bindingExpression() } } +void tst_QmlCppCodegen::bindingToScriptStringProperty() +{ + QQmlEngine engine; + QQmlComponent c(&engine, QUrl(u"qrc:/qt/qml/TestTypes/BindingToScriptStringProperty.qml"_s)); + QVERIFY2(c.isReady(), qPrintable(c.errorString())); + QScopedPointer<QObject> o(c.create()); + QVERIFY(o); + + const auto *bottomRect = o->findChild<QObject *>("bottom"); + QCOMPARE(bottomRect->property("y").toInt(), 150); + o->setProperty("c", true); + QCOMPARE(bottomRect->property("y").toInt(), 300); +} + void tst_QmlCppCodegen::blockComments() { QQmlEngine engine; |
