FieldDefinition.h header

#include <ew/core/FieldDefinition.h>

Namespace ew::core

FieldDefinition class

class ew::core::FieldDefinition

The definition of one user-defined codex field on a taxonomy category: its stable key, display label, data type, and constraints. The key is fixed at construction and used for serialization and value lookup; everything else is editable. A Category forms its schema from a list of these, and they inherit to descendant categories.

Members

ew::core::FieldDefinition::FieldDefinition(QString key, QString label, FieldType type)

Creates a field with stable key, display label, and data type.

const QString & ew::core::FieldDefinition::key() const

The stable identifier used to store and look up this field's values. Immutable.

const QString & ew::core::FieldDefinition::label() const

The human-readable label shown in the UI.

void ew::core::FieldDefinition::setLabel(QString label)

Sets the field's display label.

FieldType ew::core::FieldDefinition::type() const

The field's data type.

void ew::core::FieldDefinition::setType(FieldType type)

Sets the field's data type.

bool ew::core::FieldDefinition::isRequired() const

Whether an entity must supply a value for this field.

void ew::core::FieldDefinition::setRequired(bool isRequired)

Sets whether a value is mandatory.

const QStringList & ew::core::FieldDefinition::options() const

The allowed values, used when type() is FieldType::Choice; empty otherwise.

void ew::core::FieldDefinition::setOptions(QStringList options)

Sets the allowed values (for FieldType::Choice).

const QString & ew::core::FieldDefinition::description() const

Optional help text explaining the field's purpose.

void ew::core::FieldDefinition::setDescription(QString description)

Sets the field's help text.