Class: QgsFieldDomain¶
Base class for field domains.
A field domain is a set of constraints that apply to one or several fields.
Added in version 3.26.
Class Hierarchy¶
Subclasses¶
Definition of a coded / enumerated field domain.  | 
|
Definition of a field domain for field content validated by a glob.  | 
|
Definition of a numeric field domain with a range of validity for values.  | 
Methods
Clones the field domain.  | 
|
Returns the description of the field domain.  | 
|
Returns the associated field type.  | 
|
Returns the merge policy.  | 
|
Returns the name of the field domain.  | 
|
Sets the description of the field domain.  | 
|
Sets the associated field type.  | 
|
Sets the merge policy.  | 
|
Sets the name of the field domain.  | 
|
Sets the split policy.  | 
|
Returns the split policy.  | 
|
Returns the type of field domain.  | 
|
Returns a translated name of the field domain type.  | 
- class qgis.core.QgsFieldDomain[source]¶
 Bases:
object- __init__(name: str | None, description: str | None, fieldType: QMetaType.Type)
 Constructor for QgsFieldDomain, with the specified
name,descriptionandfieldType.- Parameters:
 name (Optional[str])
description (Optional[str])
fieldType (QMetaType.Type)
- __init__(name: str | None, description: str | None, fieldType: QVariant.Type)
 Constructor for QgsFieldDomain, with the specified
name,descriptionandfieldType.Deprecated since version 3.38: Use the method with a QMetaType.Type argument instead.
- Parameters:
 name (Optional[str])
description (Optional[str])
fieldType (QVariant.Type)
- __init__(a0: QgsFieldDomain)
 - Parameters:
 a0 (QgsFieldDomain)
- clone(self) QgsFieldDomain | None[source]¶
 Clones the field domain.
- Return type:
 Optional[QgsFieldDomain]
- description(self) str[source]¶
 Returns the description of the field domain.
See also
- Return type:
 str
- fieldType(self) QMetaType.Type[source]¶
 Returns the associated field type.
See also
- Return type:
 QMetaType.Type
- mergePolicy(self) Qgis.FieldDomainMergePolicy[source]¶
 Returns the merge policy.
See also
- Return type:
 
- setDescription(self, description: str | None)[source]¶
 Sets the
descriptionof the field domain.See also
- Parameters:
 description (Optional[str])
- setFieldType(self, type: QMetaType.Type)[source]¶
 Sets the associated field
type.See also
- Parameters:
 type (QMetaType.Type)
- setFieldType(self, type: QVariant.Type)[source]
 Sets the associated field
type.See also
Deprecated since version 3.38: Use the method with a QMetaType.Type argument instead.
- Parameters:
 type (QVariant.Type)
- setMergePolicy(self, policy: Qgis.FieldDomainMergePolicy)[source]¶
 Sets the merge
policy.See also
- Parameters:
 policy (Qgis.FieldDomainMergePolicy)
- setName(self, name: str | None)[source]¶
 Sets the
nameof the field domain.See also
- Parameters:
 name (Optional[str])
- setSplitPolicy(self, policy: Qgis.FieldDomainSplitPolicy)[source]¶
 Sets the split
policy.See also
- Parameters:
 policy (Qgis.FieldDomainSplitPolicy)
- splitPolicy(self) Qgis.FieldDomainSplitPolicy[source]¶
 Returns the split policy.
See also
- Return type:
 
- type(self) Qgis.FieldDomainType[source]¶
 Returns the type of field domain.
- Return type: