26 , mDescription( description )
27 , mFieldType( fieldType )
33 const QString &description,
34 QVariant::Type fieldType )
51 return other.mCode == mCode && other.mValue == mValue;
56 return !( *
this == other );
83 return QObject::tr(
"Coded Values" );
98QgsRangeFieldDomain::QgsRangeFieldDomain(
const QString &name,
const QString &description, QMetaType::Type fieldType,
const QVariant &minimum,
bool minimumIsInclusive,
const QVariant &maximum,
bool maximumIsInclusive )
102 , mMinIsInclusive( minimumIsInclusive )
103 , mMaxIsInclusive( maximumIsInclusive )
108QgsRangeFieldDomain::QgsRangeFieldDomain(
const QString &name,
const QString &description, QVariant::Type fieldType,
const QVariant &minimum,
bool minimumIsInclusive,
const QVariant &maximum,
bool maximumIsInclusive )
120 return QObject::tr(
"Range" );
125 std::unique_ptr< QgsRangeFieldDomain > res = std::make_unique< QgsRangeFieldDomain >(
mName,
mDescription,
mFieldType, mMin, mMinIsInclusive, mMax, mMaxIsInclusive );
128 return res.release();
155 return QObject::tr(
"Glob" );
163 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.
Definition of a coded / enumerated field domain.
QgsCodedFieldDomain * clone() const override
Clones the field domain.
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.
Associates a code and a value.
bool operator==(const QgsCodedValue &other) const
bool operator!=(const QgsCodedValue &other) const
Base class for field domains.
Qgis::FieldDomainSplitPolicy mSplitPolicy
void setFieldType(QMetaType::Type type)
Sets the associated field type.
virtual ~QgsFieldDomain()
Qgis::FieldDomainMergePolicy mMergePolicy
virtual Qgis::FieldDomainType type() const =0
Returns the type of field domain.
QMetaType::Type mFieldType
QgsFieldDomain(const QString &name, const QString &description, QMetaType::Type fieldType)
Constructor for QgsFieldDomain, with the specified name, description and fieldType.
Definition of a field domain for field content validated by a glob.
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.
QgsGlobFieldDomain * clone() const override
Clones the field domain.
Qgis::FieldDomainType type() const override
Returns the type of field domain.
Definition of a numeric field domain with a range of validity for values.
Qgis::FieldDomainType type() const override
Returns the type of field domain.
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.
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.