Commit d97ef903 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.DocumentManager: Support component property of Tab



Change-Id: Iaf2d1160904023db3c66c6e536c5cf812a71e3fb
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent fa91e7b8
......@@ -118,10 +118,33 @@ static inline void openFileForComponent(const ModelNode &node)
//rootModelNode.setAuxiliaryData("height", height);
}
static inline void openInlineComponent(const ModelNode &node)
static void handleComponent(const ModelNode &modelNode)
{
if (modelNode.nodeSourceType() == ModelNode::NodeWithComponentSource)
currentDesignDocument()->changeToSubComponent(modelNode);
}
if (!node.isValid() || !node.metaInfo().isValid())
static void handleDelegate(const ModelNode &modelNode)
{
if (modelNode.metaInfo().isView()
&& modelNode.hasNodeProperty("delegate")
&& modelNode.nodeProperty("delegate").modelNode().nodeSourceType() == ModelNode::NodeWithComponentSource)
currentDesignDocument()->changeToSubComponent(modelNode.nodeProperty("delegate").modelNode());
}
static void handleTabComponent(const ModelNode &modelNode)
{
if (modelNode.hasNodeProperty("component")
&& modelNode.nodeProperty("component").modelNode().nodeSourceType() == ModelNode::NodeWithComponentSource) {
currentDesignDocument()->changeToSubComponent(modelNode.nodeProperty("component").modelNode());
}
}
static inline void openInlineComponent(const ModelNode &modelNode)
{
if (!modelNode.isValid() || !modelNode.metaInfo().isValid())
return;
if (!currentDesignDocument())
......@@ -129,22 +152,14 @@ static inline void openInlineComponent(const ModelNode &node)
QHash<PropertyName, QVariant> propertyHash;
if (node.nodeSourceType() == ModelNode::NodeWithComponentSource) {
//getWidthHeight(node, width, height);
getProperties(node, propertyHash);
currentDesignDocument()->changeToSubComponent(node);
} else if (node.metaInfo().isView()
&& node.hasNodeProperty("delegate")
&& node.nodeProperty("delegate").modelNode().nodeSourceType() == ModelNode::NodeWithComponentSource) {
//getWidthHeight(node, width, height);
getProperties(node, propertyHash);
currentDesignDocument()->changeToSubComponent(node.nodeProperty("delegate").modelNode());
}
getProperties(modelNode, propertyHash);
handleComponent(modelNode);
handleDelegate(modelNode);
handleTabComponent(modelNode);
ModelNode rootModelNode = currentDesignDocument()->rewriterView()->rootModelNode();
applyProperties(rootModelNode, propertyHash);
//rootModelNode.setAuxiliaryData("width", width);
//rootModelNode.setAuxiliaryData("height", height);
}
static inline bool isFileComponent(const ModelNode &node)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment