forked from qt-creator/qt-creator
QmlDesigner.NodeInstances: Check expressions
I do not see any reason to set an expression that contains a code block. Change-Id: I74960a6bac741db46d86e33299e8b1669e781e65 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
This commit is contained in:
@@ -91,6 +91,14 @@ static bool isPropertyBlackListed(const QmlDesigner::PropertyName &propertyName)
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool isSimpleExpression(const QString &expression)
|
||||
{
|
||||
if (expression.startsWith(QStringLiteral("{")))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
namespace QmlDesigner {
|
||||
namespace Internal {
|
||||
|
||||
@@ -512,6 +520,9 @@ void ObjectNodeInstance::setPropertyBinding(const PropertyName &name, const QStr
|
||||
if (ignoredProperties().contains(name))
|
||||
return;
|
||||
|
||||
if (!isSimpleExpression(expression))
|
||||
return;
|
||||
|
||||
QQmlProperty property(object(), name, context());
|
||||
|
||||
if (!property.isValid())
|
||||
|
||||
Reference in New Issue
Block a user