mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-21 16:50:53 +01:00
Element editor : improve code
Better use of signal partsAdded and partsRemoved
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "graphicspart/partterminal.h"
|
||||
#include "graphicspart/parttext.h"
|
||||
#include "../QPropertyUndoCommand/qpropertyundocommand.h"
|
||||
#include "UndoCommand/deletepartscommand.h"
|
||||
|
||||
|
||||
/**
|
||||
@@ -71,29 +72,6 @@ class ElementEditionCommand : public QUndoCommand
|
||||
ElementView *m_view;
|
||||
};
|
||||
|
||||
/**
|
||||
This command deletes one or several primitives/parts when editing an
|
||||
electrical element.
|
||||
*/
|
||||
class DeletePartsCommand : public ElementEditionCommand {
|
||||
// constructors, destructor
|
||||
public:
|
||||
DeletePartsCommand(ElementScene *, const QList<QGraphicsItem *>&, QUndoCommand * = nullptr);
|
||||
~DeletePartsCommand() override;
|
||||
private:
|
||||
DeletePartsCommand(const DeletePartsCommand &);
|
||||
|
||||
// methods
|
||||
public:
|
||||
void undo() override;
|
||||
void redo() override;
|
||||
|
||||
// attributes
|
||||
private:
|
||||
/// Deleted primitives
|
||||
QList<QGraphicsItem *> deleted_parts;
|
||||
};
|
||||
|
||||
/**
|
||||
This command cut primitives when editing an electrical element.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user