Commit 749e5a00 authored by Thomas Hartmann's avatar Thomas Hartmann Committed by Thomas Hartmann

QmlDesigner: Add QmlItemNode::isInLayout()

Change-Id: I3823c000599db2b1ed326463d4310c94b96f5466
Reviewed-by: default avatarTim Jenssen <tim.jenssen@theqtcompany.com>
parent d3992542
......@@ -125,6 +125,7 @@ public:
void setPostionInBaseState(const QPointF &position);
void setSize(const QSizeF &size);
bool isInLayout() const;
};
QMLDESIGNERCORE_EXPORT uint qHash(const QmlItemNode &node);
......
......@@ -597,6 +597,19 @@ void QmlItemNode::setPostionInBaseState(const QPointF &position)
modelNode().variantProperty("y").setValue(qRound(position.y()));
}
bool QmlItemNode::isInLayout() const
{
if (isValid() && hasNodeParent()) {
ModelNode parent = modelNode().parentProperty().parentModelNode();
if (parent.isValid() && parent.metaInfo().isValid())
return parent.metaInfo().isSubclassOf("QtQuick.Layouts.Layout", -1, -1);
}
return false;
}
void QmlItemNode::setSize(const QSizeF &size)
{
if (!hasBindingProperty("width") && !anchors().instanceHasAnchor(AnchorLineRight))
......
Markdown is supported
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