QmlDesigner: Add AnchorIndicator

Change-Id: I0cd4b3c9dc0178936ffd96d8acb443ce1a228d1f
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Marco Bubke
2013-08-29 14:45:20 +02:00
parent 036ab272b8
commit 480d014b44
11 changed files with 609 additions and 3 deletions

View File

@@ -46,7 +46,8 @@ MoveTool::MoveTool(FormEditorView *editorView)
: AbstractFormEditorTool(editorView),
m_moveManipulator(editorView->scene()->manipulatorLayerItem(), editorView),
m_selectionIndicator(editorView->scene()->manipulatorLayerItem()),
m_resizeIndicator(editorView->scene()->manipulatorLayerItem())
m_resizeIndicator(editorView->scene()->manipulatorLayerItem()),
m_anchorIndicator(editorView->scene()->manipulatorLayerItem())
{
m_selectionIndicator.setCursor(Qt::SizeAllCursor);
}
@@ -63,6 +64,7 @@ void MoveTool::clear()
m_movingItems.clear();
m_selectionIndicator.clear();
m_resizeIndicator.clear();
m_anchorIndicator.clear();
AbstractFormEditorTool::clear();
}
@@ -93,6 +95,7 @@ void MoveTool::mouseMoveEvent(const QList<QGraphicsItem*> &itemList,
// m_selectionIndicator.hide();
m_resizeIndicator.hide();
m_anchorIndicator.hide();
FormEditorItem *containerItem = containerFormEditorItem(itemList, m_movingItems);
if (containerItem && view()->currentState().isBaseState()) {
@@ -150,6 +153,7 @@ void MoveTool::keyPressEvent(QKeyEvent *event)
m_moveManipulator.setItems(movableItems);
// m_selectionIndicator.hide();
m_resizeIndicator.hide();
m_anchorIndicator.hide();
m_moveManipulator.beginRewriterTransaction();
}
@@ -182,6 +186,7 @@ void MoveTool::keyReleaseEvent(QKeyEvent *keyEvent)
m_moveManipulator.clear();
// m_selectionIndicator.show();
m_resizeIndicator.show();
m_anchorIndicator.show();
}
}
@@ -206,6 +211,7 @@ void MoveTool::mouseReleaseEvent(const QList<QGraphicsItem*> &itemList,
m_selectionIndicator.show();
m_resizeIndicator.show();
m_anchorIndicator.show();
m_movingItems.clear();
}
@@ -227,6 +233,7 @@ void MoveTool::selectedItemsChanged(const QList<FormEditorItem*> &itemList)
{
m_selectionIndicator.setItems(movingItems(itemList));
m_resizeIndicator.setItems(itemList);
m_anchorIndicator.setItems(itemList);
updateMoveManipulator();
}
@@ -375,6 +382,7 @@ void MoveTool::formEditorItemsChanged(const QList<FormEditorItem*> &itemList)
{
m_selectionIndicator.updateItems(itemList);
m_resizeIndicator.updateItems(itemList);
m_anchorIndicator.updateItems(itemList);
}
}