diff --git a/src/plugins/qmldesigner/components/formeditor/movemanipulator.cpp b/src/plugins/qmldesigner/components/formeditor/movemanipulator.cpp index 4ce6ae605c65c73e13b4eeb5c582ea4e00624c49..9e51b66b33887987226f43bcd5b1510016ffae12 100644 --- a/src/plugins/qmldesigner/components/formeditor/movemanipulator.cpp +++ b/src/plugins/qmldesigner/components/formeditor/movemanipulator.cpp @@ -345,6 +345,16 @@ void MoveManipulator::moveBy(double deltaX, double deltaY) } } +void MoveManipulator::beginRewriterTransaction() +{ + m_rewriterTransaction = m_view->beginRewriterTransaction(); +} + +void MoveManipulator::endRewriterTransaction() +{ + m_rewriterTransaction.commit(); +} + void MoveManipulator::setOpacityForAllElements(qreal opacity) { foreach (FormEditorItem* item, m_itemList) diff --git a/src/plugins/qmldesigner/components/formeditor/movemanipulator.h b/src/plugins/qmldesigner/components/formeditor/movemanipulator.h index 7c6445bc43b361a43911d525323bc95d21a93fac..c82aa1e0b1c54f96ede50565b234c9def69e3d83 100644 --- a/src/plugins/qmldesigner/components/formeditor/movemanipulator.h +++ b/src/plugins/qmldesigner/components/formeditor/movemanipulator.h @@ -69,6 +69,9 @@ public: void moveBy(double deltaX, double deltaY); + void beginRewriterTransaction(); + void endRewriterTransaction(); + QPointF beginPoint() const; void clear(); diff --git a/src/plugins/qmldesigner/components/formeditor/movetool.cpp b/src/plugins/qmldesigner/components/formeditor/movetool.cpp index 6126c77ae3af743afb12819609eb585d460fb7a3..c72805736b29381e057122a9335fee0a2c65fc14 100644 --- a/src/plugins/qmldesigner/components/formeditor/movetool.cpp +++ b/src/plugins/qmldesigner/components/formeditor/movetool.cpp @@ -156,6 +156,7 @@ void MoveTool::keyPressEvent(QKeyEvent *event) m_moveManipulator.setItems(movableItems); // m_selectionIndicator.hide(); m_resizeIndicator.hide(); + m_moveManipulator.beginRewriterTransaction(); } switch(event->key()) { @@ -180,6 +181,7 @@ void MoveTool::keyReleaseEvent(QKeyEvent *keyEvent) } if (!keyEvent->isAutoRepeat()) { + m_moveManipulator.beginRewriterTransaction(); m_moveManipulator.clear(); // m_selectionIndicator.show(); m_resizeIndicator.show();