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

Undo command that adds a list of graphic elements to the scene. More...

#include <Commands.h>

Inheritance diagram for AddItemsCommand:
[legend]

Public Member Functions

 AddItemsCommand (const QList< QGraphicsItem * > &items, Scene *scene, QUndoCommand *parent=nullptr)
 Constructs the command for adding items.
void redo () override
 Adds the items to the scene.
void undo () override
 Removes the items from the scene.

Detailed Description

Undo command that adds a list of graphic elements to the scene.

Definition at line 66 of file Commands.h.

Constructor & Destructor Documentation

◆ AddItemsCommand()

AddItemsCommand::AddItemsCommand ( const QList< QGraphicsItem * > & items,
Scene * scene,
QUndoCommand * parent = nullptr )
explicit

Constructs the command for adding items.

Parameters
itemsList of GraphicElements (IO elements, gates, ICs) to add.
sceneTarget scene.
parentOptional parent undo command.

Definition at line 270 of file Commands.cpp.

References CommandUtils::addItems(), and CommandUtils::loadList().

Member Function Documentation

◆ redo()

void AddItemsCommand::redo ( )
override

Adds the items to the scene.

Definition at line 296 of file Commands.cpp.

References CommandUtils::loadItems(), and qCDebug.

◆ undo()

void AddItemsCommand::undo ( )
override

Removes the items from the scene.

Definition at line 286 of file Commands.cpp.

References CommandUtils::deleteItems(), CommandUtils::findItems(), qCDebug, and CommandUtils::saveItems().


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