Class: QgsCodedFieldDomain

class qgis.core.QgsCodedFieldDomain

Bases: QgsFieldDomain

Definition of a coded / enumerated field domain.

A code field domain is a domain for which only a limited set of codes, associated with their expanded value, are allowed. The type of the code should be the one of the field domain.

New in version 3.26.

QgsCodedFieldDomain(name: str, description: str, fieldType: QVariant.Type, values: Iterable[QgsCodedValue]) Constructor for QgsCodedFieldDomain, with the associated name, description and fieldType.

The values list details the coded field values as QgsCodedValue objects. Each code should appear only once, but it is the responsibility of the user to check this.

Methods

clone

rtype

QgsCodedFieldDomain

setValues

Sets the enumeration as QgsCodedValue values.

type

rtype

Qgis.FieldDomainType

typeName

rtype

str

values

Returns the enumeration as QgsCodedValue values.

clone(self) QgsCodedFieldDomain
Return type

QgsCodedFieldDomain

setValues(self, values: Iterable[QgsCodedValue])

Sets the enumeration as QgsCodedValue values.

See also

values()

Parameters

values (Iterable[QgsCodedValue]) –

type(self) Qgis.FieldDomainType
Return type

Qgis.FieldDomainType

typeName(self) str
Return type

str

values(self) List[QgsCodedValue]

Returns the enumeration as QgsCodedValue values.

See also

setValues()

Return type

List[QgsCodedValue]