|
wiRedPanda
Logic Circuit Simulator
|
Undo command that changes the type of selected elements while preserving connections. More...
#include <Commands.h>
Public Member Functions | |
| MorphCommand (const QList< GraphicElement * > &elements, ElementType type, Scene *scene, QUndoCommand *parent=nullptr) | |
| Constructs the morph command. | |
| void | redo () override |
| Replaces elements with instances of the new type. | |
| void | undo () override |
| Restores the original element types. | |
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 type of selected elements while preserving connections.
Definition at line 285 of file Commands.h.
|
explicit |
Constructs the morph command.
| elements | Elements to morph. |
| type | Target element type. |
| scene | Target scene. |
| parent | Optional parent undo command. |
Definition at line 693 of file Commands.cpp.
References ElementsCommand::elements(), and ElementsCommand::ElementsCommand().
|
override |
Replaces elements with instances of the new type.
Definition at line 757 of file Commands.cpp.
References ElementFactory::buildElement(), ElementsCommand::elements(), ElementsCommand::m_ids, and ElementsCommand::m_scene.
|
override |
Restores the original element types.
Definition at line 734 of file Commands.cpp.
References ElementFactory::buildElement(), ElementsCommand::elements(), ElementsCommand::m_ids, and ElementsCommand::m_scene.