Commit 3d1dde2b authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner: reduce complexity in DragTool::dragMoveEvent



Change-Id: Icacf450bfdb6dac277ec37d1e1c61145035b3913
Reviewed-by: default avatarTim Jenssen <tim.jenssen@digia.com>
parent 3b918fae
......@@ -334,25 +334,21 @@ void DragTool::createDragNode(const QMimeData *mimeData, const QPointF &scenePos
void DragTool::dragMoveEvent(const QList<QGraphicsItem*> &itemList, QGraphicsSceneDragDropEvent *event)
{
if (!m_blockMove) {
if (!m_isAborted) {
if (canHandleMimeData(event->mimeData())) {
event->accept();
if (m_dragNode.isValid()) {
FormEditorItem *targetContainerItem = targetContainerOrRootItem(itemList);
if (targetContainerItem) {
move(event->scenePos(), itemList);
} else {
end();
m_dragNode.destroy();
}
} else {
createDragNode(event->mimeData(), event->scenePos(), itemList);
}
if (!m_blockMove && !m_isAborted && canHandleMimeData(event->mimeData())) {
event->accept();
if (m_dragNode.isValid()) {
FormEditorItem *targetContainerItem = targetContainerOrRootItem(itemList);
if (targetContainerItem) {
move(event->scenePos(), itemList);
} else {
end();
m_dragNode.destroy();
}
} else {
event->ignore();
createDragNode(event->mimeData(), event->scenePos(), itemList);
}
} else{
event->ignore();
}
}
......
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