MoveFieldCommand.h header
#include <ew/core/MoveFieldCommand.h>
Namespace ew::core
MoveFieldCommand class
class ew::core::MoveFieldCommand
Command that moves a field definition to a new position among its category's own fields, reordering the schema. Undo restores the field to its previous position.
Members
ew::core::MoveFieldCommand::MoveFieldCommand(Taxonomy &taxonomy, CategoryId categoryId, QString key, std::size_t newIndex)
Creates a command that moves the field key within the category categoryId in taxonomy to newIndex (clamped to the valid range) when applied.
ew::core::MoveFieldCommand::~MoveFieldCommand() override
Destroys the command.
void ew::core::MoveFieldCommand::apply() override
Records the field's current position, then moves it to the target index. Does nothing if the category or field is absent.
void ew::core::MoveFieldCommand::undo() override
Moves the field back to its original position.
QString ew::core::MoveFieldCommand::description() const override
Returns a short description for the undo/redo UI.