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.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: clone()
, type()
, typeName()
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. |
Abstract Methods
Clones the field domain. |
|
Returns the type of field domain. |
|
Returns a translated name of the field domain type. |
Methods
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. |
- class qgis.core.QgsFieldDomain[source]¶
Bases:
object
- __init__(name: str | None, description: str | None, fieldType: QMetaType.Type)
Constructor for QgsFieldDomain, with the specified
name
,description
andfieldType
.- 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
,description
andfieldType
.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)
- abstract 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
description
of 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
name
of 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:
- abstract type(self) Qgis.FieldDomainType [source]¶
Returns the type of field domain.
- Return type: