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

Undo command that removes a list of items from the scene. More...

#include <Commands.h>

Inheritance diagram for DeleteItemsCommand:
[legend]

Public Member Functions

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

Detailed Description

Undo command that removes a list of items from the scene.

Definition at line 97 of file Commands.h.

Constructor & Destructor Documentation

◆ DeleteItemsCommand()

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

Constructs the command for deleting items.

Parameters
itemsList of QGraphicsItems to remove.
sceneTarget scene.
parentOptional parent undo command.

Definition at line 304 of file Commands.cpp.

References CommandUtils::loadList().

Member Function Documentation

◆ redo()

void DeleteItemsCommand::redo ( )
override

Removes the items from the scene.

Definition at line 320 of file Commands.cpp.

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

◆ undo()

void DeleteItemsCommand::undo ( )
override

Restores the items to the scene.

Definition at line 312 of file Commands.cpp.

References CommandUtils::loadItems(), and qCDebug.


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