SetFieldValueCommand.h header

#include <ew/core/SetFieldValueCommand.h>

Namespace ew::core

SetFieldValueCommand class

class ew::core::SetFieldValueCommand

Command that sets one field value on an entity. Undo restores the field's previous value, or clears it if the field had no value before; redo re-applies the new one.

Members

ew::core::SetFieldValueCommand::SetFieldValueCommand(Entity &entity, QString key, QString value)

Creates a command that sets field key on entity to value when applied.

ew::core::SetFieldValueCommand::~SetFieldValueCommand() override

Destroys the command.

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

Records the field's current value and sets it to the new one.

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

Restores the field's previous value (or clears it if it had none).

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

Returns a short description for the undo/redo UI.