summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/qml/qdeclarativeenginedebug.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp
index 008d054..1837366 100644
--- a/src/declarative/qml/qdeclarativeenginedebug.cpp
+++ b/src/declarative/qml/qdeclarativeenginedebug.cpp
@@ -485,24 +485,22 @@ void QDeclarativeEngineDebugServer::setBinding(int objectId,
if (object && context) {
+ QDeclarativeProperty property(object, propertyName, context);
if (isLiteralValue) {
- QDeclarativeProperty literalProperty(object, propertyName, context);
- literalProperty.write(expression);
+ property.write(expression);
+ } else if (hasValidSignal(object, propertyName)) {
+ QDeclarativeExpression *declarativeExpression = new QDeclarativeExpression(context, object, expression.toString());
+ QDeclarativePropertyPrivate::setSignalExpression(property, declarativeExpression);
+ } else if (property.isProperty()) {
+ QDeclarativeBinding *binding = new QDeclarativeBinding(expression.toString(), object, context);
+ binding->setTarget(property);
+ binding->setNotifyOnValueChanged(true);
+ QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::setBinding(property, binding);
+ if (oldBinding)
+ oldBinding->destroy();
+ binding->update();
} else {
- if (hasValidSignal(object, propertyName)) {
- QDeclarativeProperty property(object, propertyName);
- QDeclarativeExpression *declarativeExpression = new QDeclarativeExpression(context, object, expression.toString());
- QDeclarativePropertyPrivate::setSignalExpression(property, declarativeExpression);
- } else {
- QDeclarativeBinding *binding = new QDeclarativeBinding(expression.toString(), object, context);
- QDeclarativeProperty property(object, propertyName, context);
- binding->setTarget(property);
- binding->setNotifyOnValueChanged(true);
- QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::setBinding(property, binding);
- if (oldBinding)
- oldBinding->destroy();
- binding->update();
- }
+ qWarning() << "QDeclarativeEngineDebugServer::setBinding: unable to set property" << propertyName << "on object" << object;
}
}
}