QgsListFieldFormatter class

Field formatter for a list field.

This represents a list type value. Values will be represented as a comma-separated list.

Base classes

class QgsFieldFormatter
A field formatter helps to handle and display values for a field.

Constructors, destructors, conversion operators

QgsListFieldFormatter() defaulted
Default constructor of field formatter for a list field.

Public functions

auto id() const -> QString override
Returns a unique id for this field formatter.
auto representValue(QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value) const -> QString override
Create a pretty String representation of the value.

Function documentation

QString QgsListFieldFormatter::id() const override

Returns a unique id for this field formatter.

This id will later be used to identify this field formatter in the registry with QgsFieldFormatterRegistry::fieldFormatter().

This id matches the id of a QgsEditorWidgetFactory.

QString QgsListFieldFormatter::representValue(QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value) const override

Create a pretty String representation of the value.

Returns By default the string representation of the provided value as implied by the field definition is returned.