AddCategoryCommand.h header

#include <ew/core/AddCategoryCommand.h>

Namespace ew::core

AddCategoryCommand class

class ew::core::AddCategoryCommand

Command that adds a category to a taxonomy. Undo removes it and the category is retained so redo re-adds it. (A freshly added category has no children, so undo is a plain removal.)

Members

ew::core::AddCategoryCommand::AddCategoryCommand(Taxonomy &taxonomy, Category category)

Creates a command that will add category to taxonomy when applied.

ew::core::AddCategoryCommand::~AddCategoryCommand() override

Destroys the command.

void ew::core::AddCategoryCommand::apply() override

Adds the held category to the taxonomy.

void ew::core::AddCategoryCommand::undo() override

Removes the category from the taxonomy.

QString ew::core::AddCategoryCommand::description() const override

Returns a short description for the undo/redo UI.