Commit d1fa28e7 authored by Marco Bubke's avatar Marco Bubke Committed by Thomas Hartmann
Browse files

QmlDesigner: Change isPositioner in isLayoutable to catch layouts too



Change-Id: Ic6b68a57095dc94df62278666c4c3cb150eb374e
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 74a2bfb9
......@@ -101,7 +101,7 @@ void MoveManipulator::synchronizeParent(const QList<FormEditorItem*> &itemList,
}
}
if (!parentNode.metaInfo().isSubclassOf("<cpp>.QDeclarativeBasePositioner", -1, -1))
if (!parentNode.metaInfo().isLayoutable())
update(m_lastPosition, Snapper::NoSnapping, UseBaseState);
}
......@@ -346,10 +346,10 @@ void MoveManipulator::reparentTo(FormEditorItem *newParent)
if (!itemsCanReparented())
return;
if (!newParent->qmlItemNode().modelNode().metaInfo().isPositioner()
if (!newParent->qmlItemNode().modelNode().metaInfo().isLayoutable()
&& newParent->qmlItemNode().modelNode().hasParentProperty()) {
ModelNode grandParent = newParent->qmlItemNode().modelNode().parentProperty().parentModelNode();
if (grandParent.metaInfo().isPositioner())
if (grandParent.metaInfo().isLayoutable())
newParent = m_view.data()->scene()->itemForQmlItemNode(QmlItemNode(grandParent));
}
......
......@@ -538,7 +538,7 @@ void NavigatorTreeModel::moveNodesInteractive(NodeAbstractProperty parentPropert
}
}
if (parentProperty.isDefaultProperty() && parentProperty.parentModelNode().metaInfo().isPositioner()) {
if (parentProperty.isDefaultProperty() && parentProperty.parentModelNode().metaInfo().isLayoutable()) {
ModelNode currentNode = node;
if (currentNode.hasProperty("x"))
currentNode.removeProperty("x");
......
......@@ -98,7 +98,7 @@ public:
bool availableInVersion(int majorVersion, int minorVersion) const;
bool isSubclassOf(const TypeName &type, int majorVersion, int minorVersio) const;
bool isPositioner() const;
bool isLayoutable() const;
QString importDirectoryPath() const;
......
......@@ -1279,11 +1279,11 @@ void NodeMetaInfo::clearCache()
Internal::NodeMetaInfoPrivate::clearCache();
}
bool NodeMetaInfo::isPositioner() const
bool NodeMetaInfo::isLayoutable() const
{
if (majorVersion() < 2)
return isSubclassOf("<cpp>.QDeclarativeBasePositioner", -1, -1);
return isSubclassOf("QtQuick.Positioner", -1, -1);
return isSubclassOf("QtQuick.Positioner", -1, -1) || isSubclassOf("QtQuick.Layouts.Layout", -1, -1);
}
} // namespace QmlDesigner
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