31 #include <QStackedWidget>    35   , mWidgetType( widgetType )
    36   , mEditorWidget( editorWidget )
    39   , mBlockValueUpdate( false )
    43   mConstraintResultLabel = 
new QLabel( 
this );
    44   mConstraintResultLabel->setObjectName( QStringLiteral( 
"ConstraintStatus" ) );
    45   mConstraintResultLabel->setSizePolicy( QSizePolicy::Fixed, mConstraintResultLabel->sizePolicy().verticalPolicy() );
    52   if ( mEditorWidget->
widget() )
    54     mEditorWidget->
widget()->setObjectName( mEditorWidget->
field().
name() );
    70   delete mMultiEditButton;
    75   Q_ASSERT( !mWidgetType.isEmpty() );
    76   const QVariantMap config = mEditorWidget->
config();
    77   const int fieldIdx = mEditorWidget->
fieldIdx();
    98       mConstraintResultLabel->setText( QStringLiteral( 
"<font color=\"#FF9800\">%1</font>" ).arg( QChar( 0x2718 ) ) );
    99       mConstraintResultLabel->setToolTip( description.isEmpty() ? QStringLiteral( 
"<b>%1</b>: %2" ).arg( constraint, err ) : description );
   103       mConstraintResultLabel->setText( QStringLiteral( 
"<font color=\"#FFC107\">%1</font>" ).arg( QChar( 0x2718 ) ) );
   104       mConstraintResultLabel->setToolTip( description.isEmpty() ? QStringLiteral( 
"<b>%1</b>: %2" ).arg( constraint, err ) : description );
   108       mConstraintResultLabel->setText( QStringLiteral( 
"<font color=\"#259B24\">%1</font>" ).arg( QChar( 0x2714 ) ) );
   109       mConstraintResultLabel->setToolTip( description );
   116   mConstraintResultLabel->setHidden( !editable );
   121   return mEditorWidget;
   126   if ( mEditorWidget && mixed )
   136     mPreviousValue = mEditorWidget->
value();
   151     mBlockValueUpdate = 
true;
   152     mEditorWidget->
setValues( initialValue, additionalFieldValues );
   153     mBlockValueUpdate = 
false;
   155   mPreviousValue = initialValue;
   156   mPreviousAdditionalValues = additionalFieldValues;
   165   return mEditorWidget->
value();
   170 void QgsAttributeFormEditorWidget::editorWidgetValuesChanged( 
const QVariant &value, 
const QVariantList &additionalFieldValues )
   172   if ( mBlockValueUpdate )
   193 void QgsAttributeFormEditorWidget::resetValue()
   196   mBlockValueUpdate = 
true;
   198     mEditorWidget->
setValues( mPreviousValue, mPreviousAdditionalValues );
   199   mBlockValueUpdate = 
false;
   210       if ( mEditorWidget && mIsMixed )
   217 void QgsAttributeFormEditorWidget::setFieldTriggered()
   222 void QgsAttributeFormEditorWidget::onAggregateChanged()
   225     searchWidget->setAggregate( mAggregateButton->
aggregate() );
   228 void QgsAttributeFormEditorWidget::updateWidgets()
   231   bool hasMultiEditButton = ( 
editPage()->layout()->indexOf( mMultiEditButton ) >= 0 );
   233   const int fieldIndex = mEditorWidget->
fieldIdx();
   235   bool fieldReadOnly = 
false;
   238   while ( it.nextFeature( feature ) )
   243   if ( hasMultiEditButton )
   247       editPage()->layout()->removeWidget( mMultiEditButton );
   248       mMultiEditButton->setParent( 
nullptr );
   255       editPage()->layout()->addWidget( mMultiEditButton );
   266       editPage()->layout()->addWidget( mConstraintResultLabel );
   273       mAggregateButton->setVisible( 
true );
   280       mAggregateButton->setVisible( 
false );
 
This class contains context information for attribute editor widgets. 
 
#define Q_NOWARN_DEPRECATED_PUSH
 
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
 
QgsFeatureIterator getSelectedFeatures(QgsFeatureRequest request=QgsFeatureRequest()) const
Returns an iterator of the selected features. 
 
static QgsEditorWidgetRegistry * editorWidgetRegistry()
Returns the global editor widget registry, used for managing all known edit widget factories...
 
#define Q_NOWARN_DEPRECATED_POP
 
static bool fieldIsEditable(const QgsVectorLayer *layer, int fieldIndex, const QgsFeature &feature)