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 associatedname
,description
andfieldType
.The
values
list details the coded field values asQgsCodedValue
objects. Each code should appear only once, but it is the responsibility of the user to check this.Methods
- rtype:
QgsCodedFieldDomain
Sets the enumeration as
QgsCodedValue
values
.- rtype:
Qgis.FieldDomainType
- rtype:
str
Returns the enumeration as
QgsCodedValue
values.- clone(self) QgsCodedFieldDomain ¶
- Return type:
- setValues(self, values: Iterable[QgsCodedValue])¶
Sets the enumeration as
QgsCodedValue
values
.See also
- Parameters:
values (Iterable[QgsCodedValue]) –
- type(self) Qgis.FieldDomainType ¶
- Return type:
- typeName(self) str ¶
- Return type:
str
- values(self) List[QgsCodedValue] ¶
Returns the enumeration as
QgsCodedValue
values.See also
- Return type:
List[QgsCodedValue]