RemoveFieldCommand.h header

#include <ew/core/RemoveFieldCommand.h>

Namespace ew::core

RemoveFieldCommand class

class ew::core::RemoveFieldCommand

Command that removes a field definition from a taxonomy category. Undo restores the removed field at its original position, so remove/undo round-trips exactly. Entity values stored under the field's key are left untouched, so undo brings the field back with its data intact.

Members

ew::core::RemoveFieldCommand::RemoveFieldCommand(Taxonomy &taxonomy, CategoryId categoryId, QString key)

Creates a command that removes the field key from the category categoryId in taxonomy when applied.

ew::core::RemoveFieldCommand::~RemoveFieldCommand() override

Defaulted.

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

Records the field and its position, then removes it. Does nothing if the category or field is absent.

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

Reinserts the removed field at its original position.

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

Returns a short description for the undo/redo UI.