mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user