Revamp code

-Move MoveElementsCommand class from diagramcommands file to
movegraphicsitemcommand file.
-Rename the to class MoveGraphicsItemCommand.
-Minor code change to make it more modern.
This commit is contained in:
joshua
2022-11-08 22:06:50 +01:00
parent 7fede2277f
commit 9e1ef8c42f
5 changed files with 242 additions and 190 deletions

View File

@@ -20,7 +20,6 @@
#include "conductorautonumerotation.h"
#include "diagram.h"
#include "qetgraphicsitem/conductor.h"
#include "diagramcommands.h"
#include "qetgraphicsitem/conductortextitem.h"
#include "qetgraphicsitem/diagramimageitem.h"
#include "qetgraphicsitem/dynamicelementtextitem.h"
@@ -28,6 +27,7 @@
#include "qetgraphicsitem/elementtextitemgroup.h"
#include "qetgraphicsitem/independenttextitem.h"
#include "undocommand/addgraphicsobjectcommand.h"
#include "undocommand/movegraphicsitemcommand.h"
/**
@brief ElementsMover::ElementsMover Constructor
@@ -164,7 +164,7 @@ void ElementsMover::endMovement()
//Create undo move if there is a movement
if (!current_movement_.isNull()) {
QUndoCommand *quc = new MoveElementsCommand(diagram_, m_moved_content, current_movement_, undo_object);
QUndoCommand *quc = new MoveGraphicsItemCommand(diagram_, m_moved_content, current_movement_, undo_object);
undo_object->setText(quc->text());
}