|
wiRedPanda
Logic Circuit Simulator
|
Undo command that changes the number of input or output ports on selected elements. More...
#include <Commands.h>
Public Member Functions | |
| ChangePortSizeCommand (const QList< GraphicElement * > &elements, const int newPortSize, Scene *scene, const bool isInput, QUndoCommand *parent=nullptr) | |
| Constructs the command. | |
| void | redo () override |
| Applies the new port count. | |
| void | undo () override |
| Restores the old port count and connections. | |
Additional Inherited Members | |
| Protected Member Functions inherited from ElementsCommand | |
| QList< GraphicElement * > | elements () const |
| Returns the live element pointers for this command's targets, looked up by stored ID. | |
| ElementsCommand (const QList< GraphicElement * > &elements, Scene *scene, QUndoCommand *parent=nullptr) | |
| Protected Attributes inherited from ElementsCommand | |
| QList< int > | m_ids |
| Scene * | m_scene |
Undo command that changes the number of input or output ports on selected elements.
Definition at line 351 of file Commands.h.
|
explicit |
Constructs the command.
| elements | Elements whose port count will change. |
| newPortSize | Desired number of ports. |
| scene | Target scene. |
| isInput | If true, adjusts input ports; otherwise adjusts output ports. |
| parent | Optional parent undo command. |
Definition at line 959 of file Commands.cpp.
References ElementsCommand::elements(), and ElementsCommand::ElementsCommand().
|
override |
Applies the new port count.
Definition at line 968 of file Commands.cpp.
References Port::connections(), CommandUtils::drainPortConnections(), ElementsCommand::elements(), Port::graphicElement(), InMemorySnapshot, ElementsCommand::m_scene, GraphicElement::save(), and Serialization::writePandaHeader().
|
override |
Restores the old port count and connections.
Definition at line 1020 of file Commands.cpp.
References ElementsCommand::elements(), CommandUtils::findElements(), InMemorySnapshot, ElementsCommand::m_scene, and Serialization::readPandaHeader().