From 26fbb50dc2eebcfae9a5e2e153f0d6a86922b30c Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 1 Aug 2011 20:39:55 +0200 Subject: [PATCH] QmlDesigner.NodeInstances: Show binding in text if invalid If a binding on a text property cannot be evaluated it will now will be show as #binding.text# Change-Id: Ib1d5f406724b262833215d30ec0966a75f9dc971 Reviewed-on: http://codereview.qt.nokia.com/2452 Reviewed-by: Qt Sanity Bot Reviewed-by: Thomas Hartmann --- .../qml/qmlpuppet/instances/objectnodeinstance.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/qml/qmlpuppet/instances/objectnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/instances/objectnodeinstance.cpp index a0ffd18e9ee..932f22e415d 100644 --- a/share/qtcreator/qml/qmlpuppet/instances/objectnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/instances/objectnodeinstance.cpp @@ -435,8 +435,12 @@ void ObjectNodeInstance::setPropertyBinding(const QString &name, const QString & if (oldBinding && !hasValidResetBinding(name)) oldBinding->destroy(); binding->update(); - if (binding->hasError()) + if (binding->hasError()) { qDebug() <<" ObjectNodeInstance.setPropertyBinding has Error: " << object() << name << expression << binding->error().toString(); + if (property.property().userType() == QVariant::String) + property.write(QVariant(QString("#%1#").arg(expression))); + } + } else { qWarning() << "ObjectNodeInstance.setPropertyBinding: Cannot set binding for property" << name << ": property is unknown for type"; }