Terminal element can be removed from a terminal strip

This commit is contained in:
joshua
2021-05-04 19:04:06 +02:00
parent f07f4cb150
commit ded4ea555f
4 changed files with 74 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
/*
/*
Copyright 2006-2021 The QElectroTech Team
This file is part of QElectroTech.
@@ -57,4 +57,23 @@ class AddTerminalToStripCommand : public QUndoCommand
};
/**
* @brief The RemoveTerminalFromStripCommand class
* Remove a terminal from a terminal strip.
* The removed terminal become free.
*/
class RemoveTerminalFromStripCommand : public QUndoCommand
{
public:
RemoveTerminalFromStripCommand (TerminalElement *terminal, TerminalStrip *strip, QUndoCommand *parent = nullptr);
~RemoveTerminalFromStripCommand() override {}
void undo() override;
void redo() override;
private:
QPointer<TerminalElement> m_terminal;
QPointer<TerminalStrip> m_strip;
};
#endif // ADDTERMINALTOSTRIPCOMMAND_H