Commit 6a6264db authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner: Add AbstractFormEditorTool::toFormEditorItemList



Change-Id: I3b47a82b64932dc42bc2948ce4a2e8e290fc0324
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 97b3e98d
......@@ -77,6 +77,19 @@ QList<FormEditorItem*> AbstractFormEditorTool::items() const
return m_itemList;
}
QList<FormEditorItem *> AbstractFormEditorTool::toFormEditorItemList(const QList<QGraphicsItem *> &itemList)
{
QList<FormEditorItem *> formEditorItemList;
foreach (QGraphicsItem *graphicsItem, itemList) {
FormEditorItem *formEditorItem = qgraphicsitem_cast<FormEditorItem*>(graphicsItem);
if (formEditorItem)
formEditorItemList.append(formEditorItem);
}
return formEditorItemList;
}
bool AbstractFormEditorTool::topItemIsMovable(const QList<QGraphicsItem*> & itemList)
{
QGraphicsItem *firstSelectableItem = topMovableGraphicsItem(itemList);
......
......@@ -89,6 +89,7 @@ public:
void setItems(const QList<FormEditorItem*> &itemList);
QList<FormEditorItem*> items() const;
static QList<FormEditorItem*> toFormEditorItemList(const QList<QGraphicsItem*> &itemList);
static QGraphicsItem* topMovableGraphicsItem(const QList<QGraphicsItem*> &itemList);
static FormEditorItem* topMovableFormEditorItem(const QList<QGraphicsItem*> &itemList, bool selectOnlyContentItems);
bool topItemIsMovable(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