diff options
-rw-r--r-- | tests/auto/qml/qmltc/QmltcTests/qtbug120700_main.qml | 2 | ||||
-rw-r--r-- | tests/auto/qml/qmltc/tst_qmltc.cpp | 2 | ||||
-rw-r--r-- | tools/qmltc/qmltccompilerpieces.cpp | 4 |
3 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/qml/qmltc/QmltcTests/qtbug120700_main.qml b/tests/auto/qml/qmltc/QmltcTests/qtbug120700_main.qml index 2f356b456f..dd1e0cb425 100644 --- a/tests/auto/qml/qmltc/QmltcTests/qtbug120700_main.qml +++ b/tests/auto/qml/qmltc/QmltcTests/qtbug120700_main.qml @@ -16,6 +16,8 @@ TypeWithSpecialProperties { property int someComplexValueThatWillBeSet: { return 5 } property int someComplexValueThatWillNotBeSet: { return 5 } + property list<int> valueTypeList : [] + //QTBUG-114403: onValueChanged should not trigger when setting //the initial values. onSomeValueChanged: { wasSomeValueChanged = true; } diff --git a/tests/auto/qml/qmltc/tst_qmltc.cpp b/tests/auto/qml/qmltc/tst_qmltc.cpp index 816e3b1d34..85ec056343 100644 --- a/tests/auto/qml/qmltc/tst_qmltc.cpp +++ b/tests/auto/qml/qmltc/tst_qmltc.cpp @@ -846,6 +846,7 @@ void tst_qmltc::customInitialization() component.setSomeValue(valueToTest); component.setSomeComplexValueThatWillBeSet(valueToTest); component.setZ(static_cast<double>(valueToTest)); + component.setValueTypeList({1, 2, 3, 4}); }); // QTBUG-114403: onValueChanged should have not been triggered @@ -868,6 +869,7 @@ void tst_qmltc::customInitialization() QCOMPARE(created.someValueAlias(), valueToTest); QCOMPARE(created.someValueBinding(), valueToTest + 1); QCOMPARE(created.bindableZ().value(), static_cast<double>(valueToTest)); + QCOMPARE(created.valueTypeList(), QList({1, 2, 3, 4})); } // QTBUG-104094 diff --git a/tools/qmltc/qmltccompilerpieces.cpp b/tools/qmltc/qmltccompilerpieces.cpp index bdb71cff4c..cd1735bc07 100644 --- a/tools/qmltc/qmltccompilerpieces.cpp +++ b/tools/qmltc/qmltccompilerpieces.cpp @@ -242,11 +242,13 @@ void QmltcCodeGenerator::generate_createBindingOnProperty( *block += epilogue; } else { QString createBindingForNonBindable = - u"QT_PREPEND_NAMESPACE(QQmlCppBinding)::createBindingForNonBindable(" + unitVarName + u" "_s + + u"QT_PREPEND_NAMESPACE(QQmlCppBinding)::createBindingForNonBindable(" + unitVarName + u", " + scope + u", " + QString::number(functionIndex) + u", " + target + u", " + QString::number(propertyIndex) + u", " + QString::number(valueTypeIndex) + u", " + propName + u")"; // Note: in this version, the binding is set implicitly + *block << u"if (!initializedCache.contains(\"%1\"))"_s.arg(p.propertyName()); *block << createBindingForNonBindable + u";"; } } |