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:
@@ -32,6 +32,7 @@
|
||||
#include "ui/multipastedialog.h"
|
||||
#include "undocommand/changetitleblockcommand.h"
|
||||
#include "utils/conductorcreator.h"
|
||||
#include "undocommand/addgraphicsobjectcommand.h"
|
||||
|
||||
#include <QDropEvent>
|
||||
|
||||
@@ -283,16 +284,14 @@ void DiagramView::handleTextDrop(QDropEvent *e) {
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
||||
|
||||
m_diagram -> undoStack().push(
|
||||
new AddItemCommand<IndependentTextItem *>(
|
||||
iti, m_diagram, mapToScene(e->pos())));
|
||||
m_diagram->undoStack().push(new AddGraphicsObjectCommand(
|
||||
iti, m_diagram, mapToScene(e->pos())));
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 6 or later")
|
||||
#endif
|
||||
m_diagram -> undoStack().push(
|
||||
new AddItemCommand<IndependentTextItem *>(
|
||||
iti, m_diagram, e->position()));
|
||||
m_diagram->undoStack().push(new AddGraphicsObjectCommand(
|
||||
iti, m_diagram, e->position()));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user