QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsCodedFieldDomain Class Reference

Definition of a coded / enumerated field domain. More...

#include <qgsfielddomain.h>

Inheritance diagram for QgsCodedFieldDomain:
Inheritance graph
[legend]

Public Member Functions

 QgsCodedFieldDomain (const QgsCodedFieldDomain &)=delete
 QgsCodedFieldDomain cannot be copied - use clone() instead.
 
 QgsCodedFieldDomain (const QString &name, const QString &description, QMetaType::Type fieldType, const QList< QgsCodedValue > &values)
 Constructor for QgsCodedFieldDomain, with the associated name, description and fieldType.
 
Q_DECL_DEPRECATED QgsCodedFieldDomain (const QString &name, const QString &description, QVariant::Type fieldType, const QList< QgsCodedValue > &values)
 Constructor for QgsCodedFieldDomain, with the associated name, description and fieldType.
 
QgsCodedFieldDomainclone () const override
 Clones the field domain.
 
QgsCodedFieldDomainoperator= (const QgsCodedFieldDomain &)=delete
 QgsCodedFieldDomain cannot be copied - use clone() instead.
 
void setValues (const QList< QgsCodedValue > &values)
 Sets the enumeration as QgsCodedValue values.
 
Qgis::FieldDomainType type () const override
 Returns the type of field domain.
 
QString typeName () const override
 Returns a translated name of the field domain type.
 
QList< QgsCodedValuevalues () const
 Returns the enumeration as QgsCodedValue values.
 
- Public Member Functions inherited from QgsFieldDomain
 QgsFieldDomain (const QString &name, const QString &description, QMetaType::Type fieldType)
 Constructor for QgsFieldDomain, with the specified name, description and fieldType.
 
Q_DECL_DEPRECATED QgsFieldDomain (const QString &name, const QString &description, QVariant::Type fieldType)
 Constructor for QgsFieldDomain, with the specified name, description and fieldType.
 
virtual ~QgsFieldDomain ()
 
QString description () const
 Returns the description of the field domain.
 
QMetaType::Type fieldType () const
 Returns the associated field type.
 
Qgis::FieldDomainMergePolicy mergePolicy () const
 Returns the merge policy.
 
QString name () const
 Returns the name of the field domain.
 
void setDescription (const QString &description)
 Sets the description of the field domain.
 
void setFieldType (QMetaType::Type type)
 Sets the associated field type.
 
Q_DECL_DEPRECATED void setFieldType (QVariant::Type type)
 Sets the associated field type.
 
void setMergePolicy (Qgis::FieldDomainMergePolicy policy)
 Sets the merge policy.
 
void setName (const QString &name)
 Sets the name of the field domain.
 
void setSplitPolicy (Qgis::FieldDomainSplitPolicy policy)
 Sets the split policy.
 
Qgis::FieldDomainSplitPolicy splitPolicy () const
 Returns the split policy.
 

Additional Inherited Members

- Protected Attributes inherited from QgsFieldDomain
QString mDescription
 
QMetaType::Type mFieldType = QMetaType::Type::QString
 
Qgis::FieldDomainMergePolicy mMergePolicy = Qgis::FieldDomainMergePolicy::DefaultValue
 
QString mName
 
Qgis::FieldDomainSplitPolicy mSplitPolicy = Qgis::FieldDomainSplitPolicy::DefaultValue
 

Detailed Description

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.

Since
QGIS 3.26

Definition at line 241 of file qgsfielddomain.h.

Constructor & Destructor Documentation

◆ QgsCodedFieldDomain() [1/3]

QgsCodedFieldDomain::QgsCodedFieldDomain ( const QString &  name,
const QString &  description,
QMetaType::Type  fieldType,
const QList< QgsCodedValue > &  values 
)

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.

Definition at line 63 of file qgsfielddomain.cpp.

◆ QgsCodedFieldDomain() [2/3]

QgsCodedFieldDomain::QgsCodedFieldDomain ( const QString &  name,
const QString &  description,
QVariant::Type  fieldType,
const QList< QgsCodedValue > &  values 
)

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.

Deprecated:
QGIS 3.38. Use the method with a QMetaType::Type argument instead.

Definition at line 70 of file qgsfielddomain.cpp.

◆ QgsCodedFieldDomain() [3/3]

QgsCodedFieldDomain::QgsCodedFieldDomain ( const QgsCodedFieldDomain )
delete

QgsCodedFieldDomain cannot be copied - use clone() instead.

Member Function Documentation

◆ clone()

QgsCodedFieldDomain * QgsCodedFieldDomain::clone ( ) const
overridevirtual

Clones the field domain.

Implements QgsFieldDomain.

Definition at line 86 of file qgsfielddomain.cpp.

◆ operator=()

QgsCodedFieldDomain & QgsCodedFieldDomain::operator= ( const QgsCodedFieldDomain )
delete

QgsCodedFieldDomain cannot be copied - use clone() instead.

◆ setValues()

void QgsCodedFieldDomain::setValues ( const QList< QgsCodedValue > &  values)
inline

Sets the enumeration as QgsCodedValue values.

See also
values()

Definition at line 292 of file qgsfielddomain.h.

◆ type()

Qgis::FieldDomainType QgsCodedFieldDomain::type ( ) const
overridevirtual

Returns the type of field domain.

Implements QgsFieldDomain.

Definition at line 76 of file qgsfielddomain.cpp.

◆ typeName()

QString QgsCodedFieldDomain::typeName ( ) const
overridevirtual

Returns a translated name of the field domain type.

Implements QgsFieldDomain.

Definition at line 81 of file qgsfielddomain.cpp.

◆ values()

QList< QgsCodedValue > QgsCodedFieldDomain::values ( ) const
inline

Returns the enumeration as QgsCodedValue values.

See also
setValues()

Definition at line 285 of file qgsfielddomain.h.


The documentation for this class was generated from the following files: