QmlDesigner: Add isAliasExport to BindingProperty

Change-Id: I64ebe10541957f712b86a998e922a24111ad4a88
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
Thomas Hartmann
2015-07-08 11:56:03 +02:00
committed by Thomas Hartmann
parent 473c7d65d1
commit d3992542b3
2 changed files with 14 additions and 0 deletions

View File

@@ -56,6 +56,8 @@ public:
bool isList() const;
QList<ModelNode> resolveToModelNodeList() const;
bool isAliasExport() const;
protected:
BindingProperty(const PropertyName &propertyName, const Internal::InternalNodePointer &internalNode, Model* model, AbstractView *view);
};

View File

@@ -197,6 +197,18 @@ QList<ModelNode> BindingProperty::resolveToModelNodeList() const
return returnList;
}
bool BindingProperty::isAliasExport() const
{
if (!isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
return parentModelNode() == parentModelNode().view()->rootModelNode()
&& isDynamic()
&& dynamicTypeName() == "alias"
&& name() == expression()
&& parentModelNode().view()->modelNodeForId(expression()).isValid();
}
void BindingProperty::setDynamicTypeNameAndExpression(const TypeName &typeName, const QString &expression)
{
Internal::WriteLocker locker(model());