mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Element editor : improve code
Better use of signal partsAdded and partsRemoved
This commit is contained in:
@@ -132,30 +132,6 @@ class MovePartsCommand : public ElementEditionCommand {
|
||||
bool first_redo;
|
||||
};
|
||||
|
||||
/**
|
||||
This command adds a primitive when editing an electrical element.
|
||||
*/
|
||||
class AddPartCommand : public ElementEditionCommand {
|
||||
// constructors, destructor
|
||||
public:
|
||||
AddPartCommand(const QString &, ElementScene *, QGraphicsItem *, QUndoCommand * = nullptr);
|
||||
~AddPartCommand() override;
|
||||
private:
|
||||
AddPartCommand(const AddPartCommand &);
|
||||
|
||||
// methods
|
||||
public:
|
||||
void undo() override;
|
||||
void redo() override;
|
||||
|
||||
// attributes
|
||||
private:
|
||||
/// Added primitive
|
||||
QGraphicsItem *part;
|
||||
/// Prevent the first call to redo()
|
||||
bool first_redo;
|
||||
};
|
||||
|
||||
/**
|
||||
This command changes the translated names of an electrical element.
|
||||
*/
|
||||
@@ -311,5 +287,4 @@ private:
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user