53 return other.mCode == mCode && other.mValue == mValue;
58 return !( *
this == other );
85 return QObject::tr(
"Coded Values" );
122 return QObject::tr(
"Range" );
127 auto res = std::make_unique< QgsRangeFieldDomain >(
mName,
mDescription,
mFieldType, mMin, mMinIsInclusive, mMax, mMaxIsInclusive );
130 return res.release();
157 return QObject::tr(
"Glob" );
165 return res.release();
FieldDomainType
Types of field domain.
@ Coded
Coded field domain.
@ Range
Numeric range field domain (min/max).
@ Glob
Glob string pattern field domain.
QgsCodedFieldDomain * clone() const override
Clones the field domain.
QList< QgsCodedValue > values() const
Returns the enumeration as QgsCodedValue values.
QgsCodedFieldDomain(const QString &name, const QString &description, QMetaType::Type fieldType, const QList< QgsCodedValue > &values)
Constructor for QgsCodedFieldDomain, with the associated name, description and fieldType.
Qgis::FieldDomainType type() const override
Returns the type of field domain.
QString typeName() const override
Returns a translated name of the field domain type.
QgsCodedValue(const QVariant &code, const QString &value)
Constructor for QgsCodedValue, with the associated code and value.
bool operator==(const QgsCodedValue &other) const
bool operator!=(const QgsCodedValue &other) const
Qgis::FieldDomainSplitPolicy mSplitPolicy
void setFieldType(QMetaType::Type type)
Sets the associated field type.
virtual ~QgsFieldDomain()
QMetaType::Type fieldType() const
Returns the associated field type.
Qgis::FieldDomainMergePolicy mMergePolicy
virtual Qgis::FieldDomainType type() const =0
Returns the type of field domain.
QMetaType::Type mFieldType
QString name() const
Returns the name of the field domain.
QgsFieldDomain(const QString &name, const QString &description, QMetaType::Type fieldType)
Constructor for QgsFieldDomain, with the specified name, description and fieldType.
QString description() const
Returns the description of the field domain.
QgsGlobFieldDomain(const QString &name, const QString &description, QMetaType::Type fieldType, const QString &glob)
Constructor for QgsGlobFieldDomain, with the specified name, description and fieldType.
QString typeName() const override
Returns a translated name of the field domain type.
QString glob() const
Returns the glob expression.
QgsGlobFieldDomain * clone() const override
Clones the field domain.
Qgis::FieldDomainType type() const override
Returns the type of field domain.
Qgis::FieldDomainType type() const override
Returns the type of field domain.
QVariant minimum() const
Returns the minimum value.
bool maximumIsInclusive() const
Returns true if the maximum value is inclusive.
QgsRangeFieldDomain(const QString &name, const QString &description, QMetaType::Type fieldType, const QVariant &minimum, bool minimumIsInclusive, const QVariant &maximum, bool maximumIsInclusive)
Constructor for QgsRangeFieldDomain, with the specified name, description and fieldType.
QgsRangeFieldDomain * clone() const override
Clones the field domain.
bool minimumIsInclusive() const
Returns true if the minimum value is inclusive.
QVariant maximum() const
Returns the maximum value.
QString typeName() const override
Returns a translated name of the field domain type.
Contains utility functions for working with QVariants and QVariant types.
static QMetaType::Type variantTypeToMetaType(QVariant::Type variantType)
Converts a QVariant::Type to a QMetaType::Type.