16#ifndef QGSFIELDDOMAIN_H
17#define QGSFIELDDOMAIN_H
40 sipType = sipType_QgsCodedFieldDomain;
44 sipType = sipType_QgsRangeFieldDomain;
48 sipType = sipType_QgsGlobFieldDomain;
63 const QString &description,
64 QMetaType::Type fieldType );
71 const QString &description,
96 QString
name()
const {
return mName; }
103 void setName(
const QString &name ) { mName = name; }
117 void setDescription(
const QString &description ) { mDescription = description; }
124 QMetaType::Type
fieldType()
const {
return mFieldType; }
139 Q_DECL_DEPRECATED
void setFieldType( QVariant::Type type )
SIP_DEPRECATED;
174 QMetaType::Type mFieldType = QMetaType::Type::QString;
205 QVariant
code()
const {
return mCode; }
211 QString
value()
const {
return mValue; }
214 SIP_PYOBJECT __repr__();
216 QString str = QStringLiteral(
"<QgsCodedValue: %1 (%2)>" ).arg( sipCpp->code().toString(), sipCpp->value() );
217 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
253 const QString &description,
254 QMetaType::Type fieldType,
255 const QList<QgsCodedValue> &values );
265 const QString &description,
266 QVariant::Type fieldType,
292 void setValues(
const QList< QgsCodedValue> &values ) { mValues = values; }
295 SIP_PYOBJECT __repr__();
297 QString str = QStringLiteral(
"<QgsCodedFieldDomain: %1>" ).arg( sipCpp->name() );
298 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
303 QList< QgsCodedValue> mValues;
328 const QString &description,
329 QMetaType::Type fieldType,
330 const QVariant &minimum,
331 bool minimumIsInclusive,
332 const QVariant &maximum,
333 bool maximumIsInclusive );
342 const QString &description,
343 QVariant::Type fieldType,
344 const QVariant &minimum,
345 bool minimumIsInclusive,
346 const QVariant &maximum,
369 QVariant minimum()
const {
return mMin; }
379 void setMinimum(
const QVariant &minimum ) { mMin = minimum; }
415 void setMaximum(
const QVariant &maximum ) { mMax = maximum; }
434 SIP_PYOBJECT __repr__();
436 QString str = QStringLiteral(
"<QgsRangeFieldDomain: %1 %2%3, %4%5>" ).arg( sipCpp->name(),
437 sipCpp->minimumIsInclusive() ? QStringLiteral(
"[" ) : QStringLiteral(
"(" ),
438 sipCpp->minimum().toString(),
439 sipCpp->maximum().toString(),
440 sipCpp->maximumIsInclusive() ? QStringLiteral(
"]" ) : QStringLiteral(
")" ) );
441 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
448 bool mMinIsInclusive =
false;
449 bool mMaxIsInclusive =
false;
476 const QString &description,
477 QMetaType::Type fieldType,
478 const QString &glob );
487 const QString &description,
488 QVariant::Type fieldType,
510 QString glob()
const {
return mGlob; }
519 void setGlob(
const QString &glob ) { mGlob = glob; }
522 SIP_PYOBJECT __repr__();
524 QString str = QStringLiteral(
"<QgsGlobFieldDomain: %1 '%2'>" ).arg( sipCpp->name(), sipCpp->glob() );
525 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
FieldDomainMergePolicy
Merge policy for field domains.
@ DefaultValue
Use default field value.
FieldDomainSplitPolicy
Split policy for field domains.
@ DefaultValue
Use default field value.
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.
void setValues(const QList< QgsCodedValue > &values)
Sets the enumeration as QgsCodedValue values.
QgsCodedFieldDomain(const QgsCodedFieldDomain &)=delete
QgsCodedFieldDomain cannot be copied - use clone() instead.
Associates a code and a value.
QVariant code() const
Returns the associated code, which is the underlying value stored in fields.
QgsCodedValue(const QVariant &code, const QString &value)
Constructor for QgsCodedValue, with the associated code and value.
QString value() const
Returns the associated value, which is the user-friendly string representation.
Base class for field domains.
Qgis::FieldDomainMergePolicy mergePolicy() const
Returns the merge policy.
Qgis::FieldDomainSplitPolicy splitPolicy() const
Returns the split policy.
void setFieldType(QMetaType::Type type)
Sets the associated field type.
virtual ~QgsFieldDomain()
void setName(const QString &name)
Sets the name of the field domain.
QMetaType::Type fieldType() const
Returns the associated field type.
virtual Qgis::FieldDomainType type() const =0
Returns the type of field domain.
QString name() const
Returns the name of the field domain.
void setDescription(const QString &description)
Sets the description of the field domain.
void setSplitPolicy(Qgis::FieldDomainSplitPolicy policy)
Sets the split policy.
QString description() const
Returns the description of the field domain.
void setMergePolicy(Qgis::FieldDomainMergePolicy policy)
Sets the merge policy.
virtual QgsFieldDomain * clone() const =0
Clones the field domain.
virtual QString typeName() const =0
Returns a translated name of the field domain type.
Definition of a field domain for field content validated by a glob.
QgsGlobFieldDomain(const QgsGlobFieldDomain &)=delete
QgsGlobFieldDomain cannot be copied - use clone() instead.
void setGlob(const QString &glob)
Sets the glob expression.
Definition of a numeric field domain with a range of validity for values.
void setMaximumIsInclusive(bool inclusive)
Sets whether the maximum value is inclusive.
QgsRangeFieldDomain(const QgsRangeFieldDomain &)=delete
QgsRangeFieldDomain cannot be copied - use clone() instead.
void setMaximum(const QVariant &maximum)
Sets the maximum allowed value.
bool maximumIsInclusive() const
Returns true if the maximum value is inclusive.
void setMinimum(const QVariant &minimum)
Sets the minimum allowed value.
bool minimumIsInclusive() const
Returns true if the minimum value is inclusive.
void setMinimumIsInclusive(bool inclusive)
Sets whether the minimum value is inclusive.
QVariant maximum() const
Returns the maximum value.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)