17#include "moc_qgsdefaultvalue.cpp"
20 : mExpression( expression )
21 , mApplyOnUpdate( applyOnUpdate )
28 return mExpression == other.mExpression
29 && mApplyOnUpdate == other.mApplyOnUpdate;
44 return mApplyOnUpdate;
54 return !mExpression.isEmpty();
57QgsDefaultValue::operator bool()
const
59 return !mExpression.isEmpty();
The QgsDefaultValue class provides a container for managing client side default values for fields.
QgsDefaultValue(const QString &expression=QString(), bool applyOnUpdate=false)
Create a new default value with the given expression and applyOnUpdate flag.
void setApplyOnUpdate(bool applyOnUpdate)
The applyOnUpdate flag determines if this expression should also be applied when a feature is updated...
bool isValid() const
Returns if this default value should be applied.
bool operator==(const QgsDefaultValue &other) const
void setExpression(const QString &expression)
The expression will be evaluated whenever a default value needs to be calculated for a field.