QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
16 #ifndef QGSFIELDDOMAIN_H
17 #define QGSFIELDDOMAIN_H
19 #include "qgis_core.h"
40 sipType = sipType_QgsCodedFieldDomain;
44 sipType = sipType_QgsRangeFieldDomain;
48 sipType = sipType_QgsGlobFieldDomain;
63 const QString &description,
64 QVariant::Type fieldType );
81 virtual QString
typeName()
const = 0;
88 QString
name()
const {
return mName; }
95 void setName(
const QString &name ) { mName = name; }
109 void setDescription(
const QString &description ) { mDescription = description; }
158 QVariant::Type mFieldType = QVariant::Type::String;
189 QVariant
code()
const {
return mCode; }
195 QString
value()
const {
return mValue; }
198 SIP_PYOBJECT __repr__();
200 QString
str = QStringLiteral(
"<QgsCodedValue: %1 (%2)>" ).arg( sipCpp->code().toString(), sipCpp->value() );
201 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
237 const QString &description,
238 QVariant::Type fieldType,
239 const QList<QgsCodedValue> &values );
257 QList< QgsCodedValue>
values()
const {
return mValues; }
264 void setValues(
const QList< QgsCodedValue> &values ) { mValues = values; }
267 SIP_PYOBJECT __repr__();
269 QString
str = QStringLiteral(
"<QgsCodedFieldDomain: %1>" ).arg( sipCpp->name() );
270 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
275 QList< QgsCodedValue> mValues;
300 const QString &description,
301 QVariant::Type fieldType,
302 const QVariant &minimum,
303 bool minimumIsInclusive,
304 const QVariant &maximum,
305 bool maximumIsInclusive );
336 void setMinimum(
const QVariant &minimum ) { mMin = minimum; }
372 void setMaximum(
const QVariant &maximum ) { mMax = maximum; }
391 SIP_PYOBJECT __repr__();
393 QString
str = QStringLiteral(
"<QgsRangeFieldDomain: %1 %2%3, %4%5>" ).arg( sipCpp->name(),
394 sipCpp->minimumIsInclusive() ? QStringLiteral(
"[" ) : QStringLiteral(
"(" ),
395 sipCpp->minimum().toString(),
396 sipCpp->maximum().toString(),
397 sipCpp->maximumIsInclusive() ? QStringLiteral(
"]" ) : QStringLiteral(
")" ) );
398 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
405 bool mMinIsInclusive =
false;
406 bool mMaxIsInclusive =
false;
433 const QString &description,
434 QVariant::Type fieldType,
435 const QString &glob );
455 QString
glob()
const {
return mGlob; }
464 void setGlob(
const QString &glob ) { mGlob = glob; }
467 SIP_PYOBJECT __repr__();
469 QString
str = QStringLiteral(
"<QgsGlobFieldDomain: %1 '%2'>" ).arg( sipCpp->name(), sipCpp->glob() );
470 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
483 #endif // QGSFIELDDOMAIN_H
void setName(const QString &name)
Sets the name of the field domain.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
@ Glob
Glob string pattern field domain.
QString name() const
Returns the name of the field domain.
void setMaximumIsInclusive(bool inclusive)
Sets whether the maximum value is inclusive.
QgsCodedValue(const QVariant &code, const QString &value)
Constructor for QgsCodedValue, with the associated code and value.
void setDescription(const QString &description)
Sets the description of the field domain.
virtual QString typeName() const =0
Returns a translated name of the field domain type.
void setGlob(const QString &glob)
Sets the glob expression.
FieldDomainType
Types of field domain.
bool maximumIsInclusive() const
Returns true if the maximum value is inclusive.
void setValues(const QList< QgsCodedValue > &values)
Sets the enumeration as QgsCodedValue values.
void setMinimumIsInclusive(bool inclusive)
Sets whether the minimum value is inclusive.
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition of a coded / enumerated field domain.
void setFieldType(QVariant::Type type)
Sets the associated field type.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
void setMergePolicy(Qgis::FieldDomainMergePolicy policy)
Sets the merge policy.
QVariant::Type fieldType() const
Returns the associated field type.
FieldDomainSplitPolicy
Split policy for field domains.
Definition of a field domain for field content validated by a glob.
QString glob() const
Returns the glob expression.
void setMinimum(const QVariant &minimum)
Sets the minimum allowed value.
@ DefaultValue
Use default field value.
FieldDomainMergePolicy
Merge policy for field domains.
virtual QgsFieldDomain * clone() const =0
Clones the field domain.
Qgis::FieldDomainMergePolicy mergePolicy() const
Returns the merge policy.
bool minimumIsInclusive() const
Returns true if the minimum value is inclusive.
virtual Qgis::FieldDomainType type() const =0
Returns the type of field domain.
@ Range
Numeric range field domain (min/max)
QList< QgsCodedValue > values() const
Returns the enumeration as QgsCodedValue values.
Definition of a numeric field domain with a range of validity for values.
@ DefaultValue
Use default field value.
Qgis::FieldDomainSplitPolicy splitPolicy() const
Returns the split policy.
void setMaximum(const QVariant &maximum)
Sets the maximum allowed value.
QString description() const
Returns the description of the field domain.
QVariant minimum() const
Returns the minimum value.
Base class for field domains.
QVariant maximum() const
Returns the maximum value.
QString value() const
Returns the associated value, which is the user-friendly string representation.
@ Coded
Coded field domain.
void setSplitPolicy(Qgis::FieldDomainSplitPolicy policy)
Sets the split policy.
Associates a code and a value.
QVariant code() const
Returns the associated code, which is the underlying value stored in fields.