Class: QgsCodedFieldDomain¶
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.
Added in version 3.26.
Class Hierarchy¶
Base classes¶
Base class for field domains. |
Methods
Sets the enumeration as |
|
Returns the enumeration as |
- class qgis.core.QgsCodedFieldDomain[source]¶
Bases:
QgsFieldDomain
- __init__(name: str | None, description: str | None, fieldType: QMetaType.Type, values: Iterable[QgsCodedValue])
Constructor for QgsCodedFieldDomain, with the associated
name
,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.- Parameters:
name (Optional[str])
description (Optional[str])
fieldType (QMetaType.Type)
values (Iterable[QgsCodedValue])
- __init__(name: str | None, description: str | None, fieldType: QVariant.Type, values: Iterable[QgsCodedValue])
Constructor for QgsCodedFieldDomain, with the associated
name
,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.Deprecated since version 3.38: Use the method with a QMetaType.Type argument instead.
- Parameters:
name (Optional[str])
description (Optional[str])
fieldType (QVariant.Type)
values (Iterable[QgsCodedValue])
- setValues(self, values: Iterable[QgsCodedValue])[source]¶
Sets the enumeration as
QgsCodedValue
values
.See also
- Parameters:
values (Iterable[QgsCodedValue])
- values(self) List[QgsCodedValue] ¶
Returns the enumeration as
QgsCodedValue
values.See also
- Return type:
List[QgsCodedValue]