2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-01-07 12:14:35 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2010-01-07 12:14:35 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-01-07 12:14:35 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2010-01-07 12:14:35 +01:00
|
|
|
**
|
2015-09-18 11:34:48 +02:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
2016-01-15 14:57:40 +01:00
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-01-07 12:14:35 +01:00
|
|
|
|
|
|
|
|
#include "movetool.h"
|
|
|
|
|
|
|
|
|
|
#include "formeditorscene.h"
|
|
|
|
|
#include "formeditorview.h"
|
2010-01-20 15:51:58 +01:00
|
|
|
#include "formeditorwidget.h"
|
2017-06-30 18:20:56 +02:00
|
|
|
#include "formeditorgraphicsview.h"
|
2010-01-07 12:14:35 +01:00
|
|
|
|
|
|
|
|
#include "resizehandleitem.h"
|
|
|
|
|
|
|
|
|
|
#include <QApplication>
|
|
|
|
|
#include <QGraphicsSceneMouseEvent>
|
2010-01-20 15:51:58 +01:00
|
|
|
#include <QAction>
|
2012-08-06 13:42:46 +02:00
|
|
|
#include <QDebug>
|
2010-01-07 12:14:35 +01:00
|
|
|
|
|
|
|
|
namespace QmlDesigner {
|
|
|
|
|
|
|
|
|
|
MoveTool::MoveTool(FormEditorView *editorView)
|
|
|
|
|
: AbstractFormEditorTool(editorView),
|
|
|
|
|
m_moveManipulator(editorView->scene()->manipulatorLayerItem(), editorView),
|
|
|
|
|
m_selectionIndicator(editorView->scene()->manipulatorLayerItem()),
|
2013-08-29 14:45:20 +02:00
|
|
|
m_resizeIndicator(editorView->scene()->manipulatorLayerItem()),
|
2013-09-03 18:00:10 +02:00
|
|
|
m_anchorIndicator(editorView->scene()->manipulatorLayerItem()),
|
2013-09-17 14:43:24 +02:00
|
|
|
m_bindingIndicator(editorView->scene()->manipulatorLayerItem()),
|
|
|
|
|
m_contentNotEditableIndicator(editorView->scene()->manipulatorLayerItem())
|
2010-01-07 12:14:35 +01:00
|
|
|
{
|
2011-06-29 16:14:46 +02:00
|
|
|
m_selectionIndicator.setCursor(Qt::SizeAllCursor);
|
2010-01-07 12:14:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MoveTool::~MoveTool()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MoveTool::clear()
|
|
|
|
|
{
|
|
|
|
|
m_moveManipulator.clear();
|
|
|
|
|
m_movingItems.clear();
|
|
|
|
|
m_selectionIndicator.clear();
|
|
|
|
|
m_resizeIndicator.clear();
|
2013-08-29 14:45:20 +02:00
|
|
|
m_anchorIndicator.clear();
|
2013-09-03 18:00:10 +02:00
|
|
|
m_bindingIndicator.clear();
|
2013-09-17 14:43:24 +02:00
|
|
|
m_contentNotEditableIndicator.clear();
|
2011-06-29 16:14:46 +02:00
|
|
|
|
|
|
|
|
AbstractFormEditorTool::clear();
|
2017-06-30 18:20:56 +02:00
|
|
|
view()->formEditorWidget()->graphicsView()->viewport()->unsetCursor();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MoveTool::start()
|
|
|
|
|
{
|
|
|
|
|
view()->formEditorWidget()->graphicsView()->viewport()->setCursor(Qt::SizeAllCursor);
|
2010-01-07 12:14:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MoveTool::mousePressEvent(const QList<QGraphicsItem*> &itemList,
|
|
|
|
|
QGraphicsSceneMouseEvent *event)
|
|
|
|
|
{
|
2011-06-27 15:52:14 +02:00
|
|
|
if (event->button() == Qt::LeftButton) {
|
|
|
|
|
if (itemList.isEmpty())
|
|
|
|
|
return;
|
|
|
|
|
m_movingItems = movingItems(items());
|
|
|
|
|
if (m_movingItems.isEmpty())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
m_moveManipulator.setItems(m_movingItems);
|
|
|
|
|
m_moveManipulator.begin(event->scenePos());
|
|
|
|
|
}
|
2010-01-07 12:14:35 +01:00
|
|
|
|
2011-06-27 15:52:14 +02:00
|
|
|
AbstractFormEditorTool::mousePressEvent(itemList, event);
|
2010-01-07 12:14:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MoveTool::mouseMoveEvent(const QList<QGraphicsItem*> &itemList,
|
|
|
|
|
QGraphicsSceneMouseEvent *event)
|
|
|
|
|
{
|
2011-06-27 15:52:14 +02:00
|
|
|
if (m_moveManipulator.isActive()) {
|
|
|
|
|
if (m_movingItems.isEmpty())
|
|
|
|
|
return;
|
2010-01-07 12:14:35 +01:00
|
|
|
|
2011-06-27 15:52:14 +02:00
|
|
|
// m_selectionIndicator.hide();
|
|
|
|
|
m_resizeIndicator.hide();
|
2013-08-29 14:45:20 +02:00
|
|
|
m_anchorIndicator.hide();
|
2013-09-03 18:00:10 +02:00
|
|
|
m_bindingIndicator.hide();
|
2010-01-07 12:14:35 +01:00
|
|
|
|
2011-06-27 15:52:14 +02:00
|
|
|
FormEditorItem *containerItem = containerFormEditorItem(itemList, m_movingItems);
|
2013-07-31 15:22:28 +02:00
|
|
|
if (containerItem && view()->currentState().isBaseState()) {
|
2011-06-27 15:52:14 +02:00
|
|
|
if (containerItem != m_movingItems.first()->parentItem()
|
|
|
|
|
&& event->modifiers().testFlag(Qt::ShiftModifier)) {
|
2017-01-23 17:32:40 +01:00
|
|
|
|
|
|
|
|
FormEditorItem *movingItem = m_movingItems.first();
|
|
|
|
|
|
|
|
|
|
if (m_movingItems.count() > 1
|
|
|
|
|
|| (movingItem->qmlItemNode().canBereparentedTo(containerItem->qmlItemNode())))
|
2017-08-17 14:08:39 +02:00
|
|
|
m_moveManipulator.reparentTo(containerItem, MoveManipulator::EnforceReparent);
|
2011-06-27 15:52:14 +02:00
|
|
|
}
|
2010-05-26 18:05:49 +02:00
|
|
|
}
|
2010-01-07 12:14:35 +01:00
|
|
|
|
2013-05-14 16:21:29 +02:00
|
|
|
m_moveManipulator.update(event->scenePos(), generateUseSnapping(event->modifiers()));
|
2011-06-27 15:52:14 +02:00
|
|
|
}
|
2010-01-07 12:14:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MoveTool::hoverMoveEvent(const QList<QGraphicsItem*> &itemList,
|
2017-06-30 18:20:56 +02:00
|
|
|
QGraphicsSceneMouseEvent * event)
|
2010-01-07 12:14:35 +01:00
|
|
|
{
|
2017-08-09 15:43:49 +02:00
|
|
|
if (itemList.isEmpty()) {
|
|
|
|
|
view()->changeToSelectionTool();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2010-01-07 12:14:35 +01:00
|
|
|
ResizeHandleItem* resizeHandle = ResizeHandleItem::fromGraphicsItem(itemList.first());
|
|
|
|
|
if (resizeHandle) {
|
|
|
|
|
view()->changeToResizeTool();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-21 14:23:50 +02:00
|
|
|
if (view()->hasSingleSelectedModelNode() && selectedItemCursorInMovableArea(event->scenePos()))
|
|
|
|
|
return;
|
|
|
|
|
|
2010-01-07 12:14:35 +01:00
|
|
|
if (!topSelectedItemIsMovable(itemList)) {
|
|
|
|
|
view()->changeToSelectionTool();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2013-09-17 14:43:24 +02:00
|
|
|
|
2017-07-21 14:23:50 +02:00
|
|
|
if (view()->hasSingleSelectedModelNode()) {
|
2017-06-30 18:20:56 +02:00
|
|
|
view()->changeToSelectionTool();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (event->modifiers().testFlag(Qt::ShiftModifier)
|
|
|
|
|
|| event->modifiers().testFlag(Qt::ControlModifier) ) {
|
|
|
|
|
view()->changeToSelectionTool();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2013-09-17 14:43:24 +02:00
|
|
|
m_contentNotEditableIndicator.setItems(toFormEditorItemList(itemList));
|
2010-01-07 12:14:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MoveTool::keyPressEvent(QKeyEvent *event)
|
|
|
|
|
{
|
2012-11-28 20:44:03 +02:00
|
|
|
switch (event->key()) {
|
2010-01-07 12:14:35 +01:00
|
|
|
case Qt::Key_Shift:
|
|
|
|
|
case Qt::Key_Alt:
|
|
|
|
|
case Qt::Key_Control:
|
|
|
|
|
case Qt::Key_AltGr:
|
|
|
|
|
event->setAccepted(false);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double moveStep = 1.0;
|
|
|
|
|
|
|
|
|
|
if (event->modifiers().testFlag(Qt::ShiftModifier))
|
|
|
|
|
moveStep = 10.0;
|
|
|
|
|
|
|
|
|
|
if (!event->isAutoRepeat()) {
|
|
|
|
|
QList<FormEditorItem*> movableItems(movingItems(items()));
|
|
|
|
|
if (movableItems.isEmpty())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
m_moveManipulator.setItems(movableItems);
|
|
|
|
|
// m_selectionIndicator.hide();
|
|
|
|
|
m_resizeIndicator.hide();
|
2013-08-29 14:45:20 +02:00
|
|
|
m_anchorIndicator.hide();
|
2013-09-03 18:00:10 +02:00
|
|
|
m_bindingIndicator.hide();
|
2010-02-08 16:51:23 +01:00
|
|
|
m_moveManipulator.beginRewriterTransaction();
|
2010-01-07 12:14:35 +01:00
|
|
|
}
|
|
|
|
|
|
2012-11-28 20:44:03 +02:00
|
|
|
switch (event->key()) {
|
2010-01-07 12:14:35 +01:00
|
|
|
case Qt::Key_Left: m_moveManipulator.moveBy(-moveStep, 0.0); break;
|
|
|
|
|
case Qt::Key_Right: m_moveManipulator.moveBy(moveStep, 0.0); break;
|
|
|
|
|
case Qt::Key_Up: m_moveManipulator.moveBy(0.0, -moveStep); break;
|
|
|
|
|
case Qt::Key_Down: m_moveManipulator.moveBy(0.0, moveStep); break;
|
|
|
|
|
}
|
|
|
|
|
|
2011-05-10 15:09:26 +02:00
|
|
|
if (event->key() == Qt::Key_Escape && !m_movingItems.isEmpty()) {
|
|
|
|
|
event->accept();
|
|
|
|
|
view()->changeToSelectionTool();
|
|
|
|
|
}
|
2010-01-07 12:14:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MoveTool::keyReleaseEvent(QKeyEvent *keyEvent)
|
|
|
|
|
{
|
2012-11-28 20:44:03 +02:00
|
|
|
switch (keyEvent->key()) {
|
2010-01-07 12:14:35 +01:00
|
|
|
case Qt::Key_Shift:
|
|
|
|
|
case Qt::Key_Alt:
|
|
|
|
|
case Qt::Key_Control:
|
|
|
|
|
case Qt::Key_AltGr:
|
|
|
|
|
keyEvent->setAccepted(false);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!keyEvent->isAutoRepeat()) {
|
|
|
|
|
m_moveManipulator.clear();
|
|
|
|
|
// m_selectionIndicator.show();
|
|
|
|
|
m_resizeIndicator.show();
|
2013-08-29 14:45:20 +02:00
|
|
|
m_anchorIndicator.show();
|
2013-09-03 18:00:10 +02:00
|
|
|
m_bindingIndicator.show();
|
2010-01-07 12:14:35 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-16 18:42:52 +02:00
|
|
|
void MoveTool::dragLeaveEvent(const QList<QGraphicsItem*> &/*itemList*/, QGraphicsSceneDragDropEvent * /*event*/)
|
2011-09-16 14:04:53 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-16 18:42:52 +02:00
|
|
|
void MoveTool::dragMoveEvent(const QList<QGraphicsItem*> &/*itemList*/, QGraphicsSceneDragDropEvent * /*event*/)
|
2011-09-16 14:04:53 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2011-06-27 15:52:14 +02:00
|
|
|
void MoveTool::mouseReleaseEvent(const QList<QGraphicsItem*> &itemList,
|
2010-01-07 12:14:35 +01:00
|
|
|
QGraphicsSceneMouseEvent *event)
|
|
|
|
|
{
|
2011-06-27 15:52:14 +02:00
|
|
|
if (m_moveManipulator.isActive()) {
|
|
|
|
|
if (m_movingItems.isEmpty())
|
|
|
|
|
return;
|
2010-01-07 12:14:35 +01:00
|
|
|
|
2013-05-14 16:21:29 +02:00
|
|
|
m_moveManipulator.end(generateUseSnapping(event->modifiers()));
|
2010-01-07 12:14:35 +01:00
|
|
|
|
2013-05-14 16:21:29 +02:00
|
|
|
m_selectionIndicator.show();
|
|
|
|
|
m_resizeIndicator.show();
|
2013-08-29 14:45:20 +02:00
|
|
|
m_anchorIndicator.show();
|
2013-09-03 18:00:10 +02:00
|
|
|
m_bindingIndicator.show();
|
2013-05-14 16:21:29 +02:00
|
|
|
m_movingItems.clear();
|
2010-01-07 12:14:35 +01:00
|
|
|
}
|
2011-06-27 15:52:14 +02:00
|
|
|
|
|
|
|
|
AbstractFormEditorTool::mouseReleaseEvent(itemList, event);
|
2017-08-09 15:46:20 +02:00
|
|
|
|
|
|
|
|
view()->changeToSelectionTool();
|
2010-01-07 12:14:35 +01:00
|
|
|
}
|
|
|
|
|
|
2011-02-02 13:41:36 +01:00
|
|
|
void MoveTool::mouseDoubleClickEvent(const QList<QGraphicsItem*> &itemList, QGraphicsSceneMouseEvent *event)
|
2010-01-07 12:14:35 +01:00
|
|
|
{
|
2011-02-02 13:41:36 +01:00
|
|
|
AbstractFormEditorTool::mouseDoubleClickEvent(itemList, event);
|
2010-01-07 12:14:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MoveTool::itemsAboutToRemoved(const QList<FormEditorItem*> &removedItemList)
|
|
|
|
|
{
|
|
|
|
|
foreach (FormEditorItem* removedItem, removedItemList)
|
|
|
|
|
m_movingItems.removeOne(removedItem);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MoveTool::selectedItemsChanged(const QList<FormEditorItem*> &itemList)
|
|
|
|
|
{
|
|
|
|
|
m_selectionIndicator.setItems(movingItems(itemList));
|
|
|
|
|
m_resizeIndicator.setItems(itemList);
|
2013-08-29 14:45:20 +02:00
|
|
|
m_anchorIndicator.setItems(itemList);
|
2013-09-03 18:00:10 +02:00
|
|
|
m_bindingIndicator.setItems(itemList);
|
2010-01-07 12:14:35 +01:00
|
|
|
updateMoveManipulator();
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-16 17:47:39 +01:00
|
|
|
void MoveTool::instancesCompleted(const QList<FormEditorItem*> & /*itemList*/)
|
2010-12-10 22:46:18 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2011-06-30 17:30:17 +02:00
|
|
|
void MoveTool::instancesParentChanged(const QList<FormEditorItem *> &itemList)
|
|
|
|
|
{
|
|
|
|
|
m_moveManipulator.synchronizeInstanceParent(itemList);
|
|
|
|
|
}
|
|
|
|
|
|
2013-03-18 14:24:14 +01:00
|
|
|
void MoveTool::instancePropertyChange(const QList<QPair<ModelNode, PropertyName> > & /*propertyList*/)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2010-01-07 12:14:35 +01:00
|
|
|
bool MoveTool::haveSameParent(const QList<FormEditorItem*> &itemList)
|
|
|
|
|
{
|
|
|
|
|
if (itemList.isEmpty())
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
QGraphicsItem *firstParent = itemList.first()->parentItem();
|
|
|
|
|
foreach (FormEditorItem* item, itemList)
|
|
|
|
|
{
|
|
|
|
|
if (firstParent != item->parentItem())
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool MoveTool::isAncestorOfAllItems(FormEditorItem* maybeAncestorItem,
|
|
|
|
|
const QList<FormEditorItem*> &itemList)
|
|
|
|
|
{
|
|
|
|
|
foreach (FormEditorItem* item, itemList)
|
|
|
|
|
{
|
|
|
|
|
if (!maybeAncestorItem->isAncestorOf(item) && item != maybeAncestorItem)
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FormEditorItem* MoveTool::ancestorIfOtherItemsAreChild(const QList<FormEditorItem*> &itemList)
|
|
|
|
|
{
|
|
|
|
|
if (itemList.isEmpty())
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (FormEditorItem* item, itemList)
|
|
|
|
|
{
|
|
|
|
|
if (isAncestorOfAllItems(item, itemList))
|
|
|
|
|
return item;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MoveTool::updateMoveManipulator()
|
|
|
|
|
{
|
|
|
|
|
if (m_moveManipulator.isActive())
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MoveTool::beginWithPoint(const QPointF &beginPoint)
|
|
|
|
|
{
|
|
|
|
|
m_movingItems = movingItems(items());
|
|
|
|
|
if (m_movingItems.isEmpty())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
m_moveManipulator.setItems(m_movingItems);
|
|
|
|
|
m_moveManipulator.begin(beginPoint);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-28 14:51:05 +02:00
|
|
|
QList<FormEditorItem*> movalbeItems(const QList<FormEditorItem*> &itemList)
|
|
|
|
|
{
|
|
|
|
|
QList<FormEditorItem*> filteredItemList(itemList);
|
|
|
|
|
|
|
|
|
|
QMutableListIterator<FormEditorItem*> listIterator(filteredItemList);
|
|
|
|
|
while (listIterator.hasNext()) {
|
|
|
|
|
FormEditorItem *item = listIterator.next();
|
2013-09-04 13:10:08 +02:00
|
|
|
if (!item->qmlItemNode().isValid()
|
|
|
|
|
|| !item->qmlItemNode().instanceIsMovable()
|
|
|
|
|
|| !item->qmlItemNode().modelIsMovable()
|
|
|
|
|
|| item->qmlItemNode().instanceIsInLayoutable())
|
2010-09-28 14:51:05 +02:00
|
|
|
listIterator.remove();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return filteredItemList;
|
|
|
|
|
}
|
2010-01-07 12:14:35 +01:00
|
|
|
|
|
|
|
|
QList<FormEditorItem*> MoveTool::movingItems(const QList<FormEditorItem*> &selectedItemList)
|
|
|
|
|
{
|
2010-09-28 14:51:05 +02:00
|
|
|
QList<FormEditorItem*> filteredItemList = movalbeItems(selectedItemList);
|
|
|
|
|
|
|
|
|
|
FormEditorItem* ancestorItem = ancestorIfOtherItemsAreChild(filteredItemList);
|
2010-01-07 12:14:35 +01:00
|
|
|
|
|
|
|
|
if (ancestorItem != 0 && ancestorItem->qmlItemNode().isRootNode()) {
|
|
|
|
|
// view()->changeToSelectionTool();
|
|
|
|
|
return QList<FormEditorItem*>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ancestorItem != 0 && ancestorItem->parentItem() != 0) {
|
|
|
|
|
QList<FormEditorItem*> ancestorItemList;
|
|
|
|
|
ancestorItemList.append(ancestorItem);
|
|
|
|
|
return ancestorItemList;
|
|
|
|
|
}
|
|
|
|
|
|
2010-09-28 14:51:05 +02:00
|
|
|
if (!haveSameParent(filteredItemList)) {
|
2010-01-07 12:14:35 +01:00
|
|
|
// view()->changeToSelectionTool();
|
|
|
|
|
return QList<FormEditorItem*>();
|
|
|
|
|
}
|
|
|
|
|
|
2010-09-28 14:51:05 +02:00
|
|
|
return filteredItemList;
|
2010-01-07 12:14:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MoveTool::formEditorItemsChanged(const QList<FormEditorItem*> &itemList)
|
|
|
|
|
{
|
2013-10-14 19:22:01 +02:00
|
|
|
const QList<FormEditorItem*> selectedItemList = filterSelectedModelNodes(itemList);
|
|
|
|
|
|
|
|
|
|
m_selectionIndicator.updateItems(selectedItemList);
|
|
|
|
|
m_resizeIndicator.updateItems(selectedItemList);
|
|
|
|
|
m_anchorIndicator.updateItems(selectedItemList);
|
|
|
|
|
m_bindingIndicator.updateItems(selectedItemList);
|
2013-12-18 15:17:07 +01:00
|
|
|
m_contentNotEditableIndicator.updateItems(selectedItemList);
|
2010-01-07 12:14:35 +01:00
|
|
|
}
|
|
|
|
|
|
2016-10-11 13:04:07 +02:00
|
|
|
void MoveTool::focusLost()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2010-01-07 12:14:35 +01:00
|
|
|
}
|