23#include "moc_qgsattributesformtreeviewindicatorprovider.cpp"
25using namespace Qt::StringLiterals;
35 for (
int i = indexFrom; i <= indexTo; ++i )
53std::unique_ptr<QgsAttributesFormTreeViewIndicator> QgsAttributesFormTreeViewIndicatorProvider::newIndicator(
QgsAttributesFormItem *item )
55 auto indicator = std::make_unique<QgsAttributesFormTreeViewIndicator>(
this );
57 indicator->setToolTip( tooltipText( item ) );
65 if ( acceptsItem( item ) )
74 indicator->setToolTip( tooltipText( item ) );
85 removeItemIndicator( item );
100 indicator->deleteLater();
178 bool hardConstraint =
false;
184 hardConstraint =
true;
188 if ( !hardConstraint )
194 hardConstraint =
true;
199 if ( !hardConstraint )
205 hardConstraint =
true;
210 return hardConstraint ? u
"/field_indicators/mIndicatorConstraintHard.svg"_s : u
"/field_indicators/mIndicatorConstraint.svg"_s;
219 return u
"%1 (%2, %3)"_s.arg(
240 tooltipText += !constraints.constraintDescription().isEmpty() ? u
"\n "_s + constraints.constraintDescription() : QString();
265 QString iconName = u
"/field_indicators/mIndicatorDefaultValue.svg"_s;
271 iconName = u
"/field_indicators/mIndicatorDefaultValueApplyOnUpdate.svg"_s;
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.