aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlobjectcreator.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2016-11-30 15:50:47 +0100
committerLars Knoll <lars.knoll@qt.io>2016-12-09 08:30:57 +0000
commite54e4408bd03edc789370dd7670eb6da25e8a9bb (patch)
treec64c3ae0d48300441f5aa4d738f00a89d4973095 /src/qml/qml/qqmlobjectcreator.cpp
parent68d73a253a974967e18ba23719af31fd47434585 (diff)
Minor cleanup
Change-Id: I091f2de77f84fb298404dc8784defcf3a812d56a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index f450cbf965..ba3c6600b8 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -809,13 +809,14 @@ bool QQmlObjectCreator::setPropertyBinding(const QQmlPropertyData *property, con
// the result is written to a value type virtual property, that contains the sub-index
// of the "x" property.
QQmlBinding *qmlBinding;
+ const QQmlPropertyData *prop = property;
+ const QQmlPropertyData *subprop = nullptr;
if (_valueTypeProperty) {
- qmlBinding = QQmlBinding::create(_valueTypeProperty, function, _scopeObject, context);
- qmlBinding->setTarget(_bindingTarget, *_valueTypeProperty, property);
- } else {
- qmlBinding = QQmlBinding::create(property, function, _scopeObject, context);
- qmlBinding->setTarget(_bindingTarget, *property, nullptr);
+ prop = _valueTypeProperty;
+ subprop = property;
}
+ qmlBinding = QQmlBinding::create(prop, function, _scopeObject, context);
+ qmlBinding->setTarget(_bindingTarget, *prop, subprop);
sharedState->allCreatedBindings.push(QQmlAbstractBinding::Ptr(qmlBinding));