16 #ifndef QGSFIELDCONSTRAINTS_H 17 #define QGSFIELDCONSTRAINTS_H 23 #include "qgis_core.h" 36 Q_PROPERTY( Constraints constraints READ constraints )
45 ConstraintNotNull = 1,
46 ConstraintUnique = 1 << 1,
47 ConstraintExpression = 1 << 2,
56 ConstraintOriginNotSet = 0,
66 ConstraintStrengthNotSet = 0,
125 QString constraintExpression()
const;
142 void setConstraintExpression(
const QString &expression,
const QString &description = QString() );
149 Constraints mConstraints =
nullptr;
152 QHash< Constraint, ConstraintOrigin > mConstraintOrigins;
155 QHash< Constraint, ConstraintStrength > mConstraintStrengths;
158 QString mExpressionConstraint;
161 QString mExpressionConstraintDescription;
164 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsFieldConstraints::Constraints )
166 #endif //QGSFIELDCONSTRAINTS_H Constraint was set by layer.
Constraint
Constraints which may be present on a field.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
ConstraintOrigin
Origin of constraints.
QString constraintDescription() const
Returns the descriptive name for the constraint expression.
Stores information about constraints which may be present on a field.
Constraint was set at data provider.
User is warned if constraint is violated but feature can still be accepted.
ConstraintStrength
Strength of constraints.
Constraints constraints() const
Returns any constraints which are present for the field.
Constraint must be honored before feature can be accepted.
void removeConstraint(Constraint constraint)
Removes a constraint from the field.