21 if ( !( mConstraints & constraint ) )
29 if ( !( mConstraints & constraint ) )
45 mConstraintStrengths.remove( constraint );
49 mConstraintStrengths.insert( constraint, strength );
57 mConstraints &= ~constraint;
58 mConstraintOrigins.remove( constraint );
59 mConstraintStrengths.remove( constraint );
63 mConstraints |= constraint;
64 mConstraintOrigins.insert( constraint, origin );
79 if ( expression.isEmpty() )
87 mExpressionConstraint = expression;
88 mExpressionConstraintDescription = description;
93 return mConstraints == other.mConstraints && mConstraintOrigins == other.mConstraintOrigins
94 && mExpressionConstraint == other.mExpressionConstraint && mExpressionConstraintDescription == other.mExpressionConstraintDescription
95 && mConstraintStrengths == other.mConstraintStrengths;
void setConstraintStrength(Constraint constraint, ConstraintStrength strength)
Sets the strength of a constraint.
Constraint was set by layer.
ConstraintStrength constraintStrength(Constraint constraint) const
Returns the strength of a field constraint, or ConstraintStrengthNotSet if the constraint is not pres...
Constraint
Constraints which may be present on a field.
ConstraintOrigin
Origin of constraints.
Stores information about constraints which may be present on a field.
Constraint was set at data provider.
Field has an expression constraint set. See constraintExpression().
void setConstraint(Constraint constraint, ConstraintOrigin origin=ConstraintOriginLayer)
Sets a constraint on the field.
void setConstraintExpression(const QString &expression, const QString &description=QString())
Set the constraint expression for the field.
ConstraintStrength
Strength of constraints.
bool operator==(const QgsFieldConstraints &other) const
ConstraintOrigin constraintOrigin(Constraint constraint) const
Returns the origin of a field constraint, or ConstraintOriginNotSet if the constraint is not present ...
QgsFieldConstraints()
Constructor for QgsFieldConstraints.
QString constraintExpression() const
Returns the constraint expression for the field, if set.
Constraint must be honored before feature can be accepted.