wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
ElementsCommand Class Reference

Intermediate base for commands that operate on a fixed list of GraphicElements. More...

#include <Commands.h>

Inheritance diagram for ElementsCommand:
[legend]

Protected Member Functions

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

QList< int > m_ids
Scenem_scene

Detailed Description

Intermediate base for commands that operate on a fixed list of GraphicElements.

Stores the scene pointer and the stable element IDs captured at construction time, and exposes an elements() accessor that resolves them back to live pointers at undo/redo time. Eliminates the repeated m_ids + m_scene + findElements() boilerplate across command subclasses.

Definition at line 50 of file Commands.h.

Constructor & Destructor Documentation

◆ ElementsCommand()

ElementsCommand::ElementsCommand ( const QList< GraphicElement * > & elements,
Scene * scene,
QUndoCommand * parent = nullptr )
explicitprotected

Member Function Documentation

◆ elements()

Member Data Documentation

◆ m_ids

QList<int> ElementsCommand::m_ids
protected

Definition at line 59 of file Commands.h.

Referenced by elements(), ElementsCommand(), MorphCommand::redo(), and MorphCommand::undo().

◆ m_scene


The documentation for this class was generated from the following files: