Replace AddItemCommand class by AddGraphicsObjectCommand

The class is the same except the name and the use of QPointer to avoid
segfault with deleted QGraphicsObject.
This commit is contained in:
joshua
2021-02-07 16:20:55 +01:00
parent ac23010559
commit 0c4f87bd76
14 changed files with 180 additions and 94 deletions

View File

@@ -18,7 +18,7 @@
#include "deleteqgraphicsitemcommand.h"
#include "../diagram.h"
#include "../diagramcommands.h"
#include "addgraphicsobjectcommand.h"
#include "../qetdiagrameditor.h"
#include "../qetgraphicsitem/ViewItem/qetgraphicstableitem.h"
#include "../qetgraphicsitem/conductor.h"
@@ -202,7 +202,7 @@ void DeleteQGraphicsItemCommand::setPotentialsOfRemovedElements()
#endif
Conductor *new_cond = new Conductor(hub_terminal, t);
new_cond->setProperties(properties);
new AddItemCommand<Conductor*>(new_cond, t->diagram(), QPointF(), this);
new AddGraphicsObjectCommand(new_cond, t->diagram(), QPointF(), this);
}
}
}