16#ifndef QGSFIELDCONSTRAINTS_H
17#define QGSFIELDCONSTRAINTS_H
45 ConstraintNotNull = 1,
46 ConstraintUnique = 1 << 1,
47 ConstraintExpression = 1 << 2,
56 ConstraintOriginNotSet = 0,
66 ConstraintStrengthNotSet = 0,
88 ConstraintOrigin constraintOrigin( Constraint constraint )
const;
97 ConstraintStrength constraintStrength( Constraint constraint )
const;
104 void setConstraintStrength( Constraint constraint, ConstraintStrength strength );
111 void setConstraint( Constraint constraint, ConstraintOrigin origin = ConstraintOriginLayer );
126 QString constraintExpression()
const;
143 void setConstraintExpression(
const QString &expression,
const QString &description = QString() );
167 Constraints mConstraints;
170 QHash< Constraint, ConstraintOrigin > mConstraintOrigins;
173 QHash< Constraint, ConstraintStrength > mConstraintStrengths;
176 QString mExpressionConstraint;
179 QString mExpressionConstraintDescription;
Stores information about constraints which may be present on a field.
ConstraintStrength
Strength of constraints.
@ ConstraintStrengthSoft
User is warned if constraint is violated but feature can still be accepted.
@ ConstraintStrengthHard
Constraint must be honored before feature can be accepted.
ConstraintOrigin
Origin of constraints.
@ ConstraintOriginProvider
Constraint was set at data provider.
@ ConstraintOriginLayer
Constraint was set by layer.
void setDomainName(const QString &domain)
Sets the associated field domain name, for providers which support field domains.
QString domainName() const
Returns the associated field domain name, for providers which support field domains.
Constraint
Constraints which may be present on a field.
Constraints constraints() const
Returns any constraints which are present for the field.
void removeConstraint(Constraint constraint)
Removes a constraint from the field.
QString constraintDescription() const
Returns the descriptive name for the constraint expression.
QgsFieldConstraints()
Constructor for QgsFieldConstraints.
QFlags< Constraint > Constraints
#define SIP_ENUM_BASETYPE(type)
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsTextRendererUtils::CurvedTextFlags)