aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlobjectcreator.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2020-09-03 10:42:30 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2020-09-04 06:55:55 +0000
commitf942a777f5a6ca241e4a804db518b5f4eb73dcc3 (patch)
treef94fc98d09cec550f3bc5e4a9748e20b543467a2 /src/qml/qml/qqmlobjectcreator.cpp
parente7899df08030030930a3e30f0c8947275328e4f0 (diff)
Adjust to qtbase changes
- isQProperty has been renamed to bindable - QNotifiedProperty is no more - Bindable properties have a function to obtain the QBindable; store that information in the qmltypes files. Task-number: QTBUG-86434 Task-number: QTBUG-86435 Change-Id: I2ba593af1e197d04d2c30cfb9e6904a3d2059e4b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index 5eb885c2e0..dc720349a1 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -928,15 +928,17 @@ bool QQmlObjectCreator::setPropertyBinding(const QQmlPropertyData *bindingProper
_bindingTarget, signalIndex, context,
_scopeObject, runtimeFunction, currentQmlContext());
- if (bindingProperty->isQProperty()) {
+ if (bindingProperty->isBindable()) {
auto &observer = QQmlData::get(_scopeObject)->propertyObservers.emplace_back(expr);
- void *argv[] = { &observer };
- _bindingTarget->qt_metacall(QMetaObject::RegisterQPropertyObserver, bindingProperty->coreIndex(), argv);
+ QUntypedBindable bindable;
+ void *argv[] = { &bindable };
+ _bindingTarget->qt_metacall(QMetaObject::BindableProperty, bindingProperty->coreIndex(), argv);
+ bindable.observe(&observer);
} else {
QQmlBoundSignal *bs = new QQmlBoundSignal(_bindingTarget, signalIndex, _scopeObject, engine);
bs->takeExpression(expr);
}
- } else if (bindingProperty->isQProperty()) {
+ } else if (bindingProperty->isBindable()) {
QUntypedPropertyBinding qmlBinding;
if (binding->isTranslationBinding()) {
qmlBinding = QQmlTranslationPropertyBinding::create(bindingProperty, compilationUnit, binding);
@@ -1447,8 +1449,10 @@ bool QQmlObjectCreator::finalize(QQmlInstantiationInterrupt &interrupt)
while (!sharedState->allQPropertyBindings.isEmpty()) {
auto& [target, index, qmlBinding] = sharedState->allQPropertyBindings.last();
- void *argv[] = { &qmlBinding };
- target->qt_metacall(QMetaObject::SetQPropertyBinding, index, argv);
+ QUntypedBindable bindable;
+ void *argv[] = { &bindable };
+ target->qt_metacall(QMetaObject::BindableProperty, index, argv);
+ bindable.setBinding(qmlBinding);
sharedState->allQPropertyBindings.pop_back();
if (watcher.hasRecursed() || interrupt.shouldInterrupt())
return false;