Commit f617295f authored by Marco Bubke's avatar Marco Bubke

QmlDesigner: Refactor AbstractFormEditorTool::topMovableFormEditorItem

Change-Id: If3292bd55f5efcde27b374b3902e9bf0b0678356
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 75e57f36
......@@ -139,12 +139,16 @@ QGraphicsItem *AbstractFormEditorTool::topMovableGraphicsItem(const QList<QGraph
return 0;
}
FormEditorItem *AbstractFormEditorTool::topMovableFormEditorItem(const QList<QGraphicsItem*> &itemList)
FormEditorItem *AbstractFormEditorTool::topMovableFormEditorItem(const QList<QGraphicsItem*> &itemList, bool selectOnlyContentItems)
{
foreach (QGraphicsItem *item, itemList) {
FormEditorItem *formEditorItem = FormEditorItem::fromQGraphicsItem(item);
if (formEditorItem
&& (formEditorItem->qmlItemNode().instanceHasShowContent()))
&& formEditorItem->qmlItemNode().isValid()
&& !formEditorItem->qmlItemNode().instanceIsInLayoutable()
&& formEditorItem->qmlItemNode().instanceIsMovable()
&& formEditorItem->qmlItemNode().modelIsMovable()
&& (formEditorItem->qmlItemNode().instanceHasShowContent() || !selectOnlyContentItems))
return formEditorItem;
}
......
......@@ -90,7 +90,7 @@ public:
QList<FormEditorItem*> items() const;
static QGraphicsItem* topMovableGraphicsItem(const QList<QGraphicsItem*> &itemList);
static FormEditorItem* topMovableFormEditorItem(const QList<QGraphicsItem*> &itemList);
static FormEditorItem* topMovableFormEditorItem(const QList<QGraphicsItem*> &itemList, bool selectOnlyContentItems);
bool topItemIsMovable(const QList<QGraphicsItem*> &itemList);
bool topSelectedItemIsMovable(const QList<QGraphicsItem*> &itemList);
bool topItemIsResizeHandle(const QList<QGraphicsItem*> &itemList);
......
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