21#include "moc_qgsattributesformtreeviewindicatorprovider.cpp"
32 for (
int i = indexFrom; i <= indexTo; ++i )
50std::unique_ptr<QgsAttributesFormTreeViewIndicator> QgsAttributesFormTreeViewIndicatorProvider::newIndicator(
QgsAttributesFormItem *item )
52 auto indicator = std::make_unique<QgsAttributesFormTreeViewIndicator>(
this );
54 indicator->setToolTip( tooltipText( item ) );
62 if ( acceptsItem( item ) )
71 indicator->setToolTip( tooltipText( item ) );
82 removeItemIndicator( item );
97 indicator->deleteLater();
176 bool hardConstraint =
false;
182 hardConstraint =
true;
186 if ( !hardConstraint )
192 hardConstraint =
true;
197 if ( !hardConstraint )
203 hardConstraint =
true;
208 return hardConstraint ? QStringLiteral(
"/field_indicators/mIndicatorConstraintHard.svg" ) : QStringLiteral(
"/field_indicators/mIndicatorConstraint.svg" );
234 tooltipText += !constraints.constraintDescription().isEmpty() ? QStringLiteral(
"\n " ) + constraints.constraintDescription() : QString();
260 QString iconName = QStringLiteral(
"/field_indicators/mIndicatorDefaultValue.svg" );
266 iconName = QStringLiteral(
"/field_indicators/mIndicatorDefaultValueApplyOnUpdate.svg" );
279 text += QStringLiteral(
"\n(%1)" ).arg( config.
mApplyDefaultValueOnUpdate ? tr(
"Apply on update" ) : tr(
"Do not apply on update" ) );
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
QgsFieldConstraintIndicatorProvider(QgsAttributesFormBaseView *view)
Constructor for QgsFieldConstraintIndicatorProvider.
Stores information about constraints which may be present on a field.
@ ConstraintStrengthHard
Constraint must be honored before feature can be accepted.
@ ConstraintOriginNotSet
Constraint is not set.
@ ConstraintOriginProvider
Constraint was set at data provider.
Constraint
Constraints which may be present on a field.
@ ConstraintNotNull
Field may not be null.
@ ConstraintUnique
Field must have a unique value.
@ ConstraintExpression
Field has an expression constraint set. See constraintExpression().
QgsFieldDefaultValueIndicatorProvider(QgsAttributesFormBaseView *view)
Constructor for QgsFieldDefaultValueIndicatorProvider.