94 void displayWarning(
const QString &message );
102 void hideButtonBox();
110 void showButtonBox();
118 void disconnectButtonBox();
170 bool eventFilter( QObject *
object, QEvent *event )
override;
194 QString aggregateFilter()
const;
289 void changeAttribute(
const QString &
field,
const QVariant &value,
const QString &hintText = QString() );
314 bool saveWithDetails( QString *error
SIP_OUT =
nullptr );
330 void refreshFeature();
341 void parentFormValueChanged(
const QString &attribute,
const QVariant &newValue );
347 bool needsGeometry()
const;
350 void onAttributeChanged(
const QVariant &value,
const QVariantList &additionalFieldValues );
351 void onAttributeAdded(
int idx );
352 void onAttributeDeleted(
int idx );
353 void onRelatedFeaturesChanged();
354 void onUpdatedFields();
355 void onConstraintStatusChanged(
const QString &constraint,
357 void preventFeatureRefresh();
358 void synchronizeState();
359 void layerSelectionChanged();
362 bool saveMultiEdits();
363 void resetMultiEdit(
bool promptToSave =
false );
364 void multiEditMessageClicked(
const QString &link );
366 void filterAndTriggered();
367 void filterOrTriggered();
368 void filterTriggered();
372 void searchSetSelection();
373 void searchAddToSelection();
374 void searchRemoveFromSelection();
375 void searchIntersectSelection();
386 bool fieldIsEditable(
int fieldIndex )
const;
390 void updateFieldDependencies();
395 void setMultiEditFeatureIdsRelations(
const QgsFeatureIds &fids );
399 QWidget *widget =
nullptr;
403 bool labelOnTop =
false;
404 bool labelAlignRight =
false;
405 bool showLabel =
true;
415 void createWrappers();
416 void afterWidgetInit();
418 void scanForEqualAttributes(
QgsFeatureIterator &fit, QSet< int > &mixedValueFields, QHash< int, QVariant > &fieldSharedValues )
const;
421 bool saveEdits( QString *error );
426 void updateValuesDependencies(
const int originIdx );
427 void updateValuesDependenciesDefaultValues(
const int originIdx );
428 void updateValuesDependenciesVirtualFields(
const int originIdx );
429 void updateRelatedLayerFields();
431 void clearMultiEditMessages();
432 void pushSelectedFeaturesMessage();
435 QString createFilterExpression()
const;
440 void updateAllConstraints();
442 void updateContainersVisibility();
445 bool currentFormValuesFeature(
QgsFeature &feature );
446 bool currentFormValidConstraints( QStringList &invalidFields, QStringList &descriptions )
const;
447 bool currentFormValidHardConstraints( QStringList &invalidFields, QStringList &descriptions )
const;
457 bool mOwnsMessageBar;
460 QList<QgsWidgetWrapper *> mWidgets;
462 std::unique_ptr<QgsExpressionContextScope> mExtraContextScope;
463 QDialogButtonBox *mButtonBox =
nullptr;
464 QWidget *mSearchButtonBox =
nullptr;
465 QList<QgsAttributeFormInterface *> mInterfaces;
466 QMultiMap< int, QgsAttributeFormEditorWidget * > mFormEditorWidgets;
467 QList< QgsAttributeFormWidget *> mFormWidgets;
468 QMap<const QgsVectorLayerJoinInfo *, QgsFeature> mJoinedFeatures;
469 QMap<QLabel *, QgsProperty> mLabelDataDefinedProperties;
470 bool mValuesInitialized =
false;
472 bool mIsSettingFeature =
false;
474 bool mValidConstraints =
true;
477 struct ContainerInformation
480 : tabWidget( tabWidget )
482 , expression( expression )
486 ContainerInformation( QWidget *widget,
const QgsExpression &expression )
488 , expression( expression )
492 ContainerInformation( QWidget *widget,
const QgsExpression &visibilityExpression,
bool collapsed,
const QgsExpression &collapsedExpression )
494 , expression( visibilityExpression )
496 , isCollapsed( collapsed )
497 , collapsedExpression( collapsedExpression )
502 QWidget *widget =
nullptr;
505 bool isCollapsed =
false;
511 void registerContainerInformation( ContainerInformation *info );
515 void reloadIcon(
const QString &file,
const QString &tooltip, QSvgWidget *sw );
518 QVector<ContainerInformation *> mContainerVisibilityCollapsedInformation;
519 QMap<QString, QVector<ContainerInformation *> > mContainerInformationDependency;
522 static int sFormCounter;
524 QString mPyFormVarName;
530 bool mPreventFeatureRefresh;
532 bool mIsSettingMultiEditFeatures;
535 bool mUnsavedMultiEditChanges;
537 QString mEditCommandMessage;
541 QMap<QWidget *, QSvgWidget *> mIconMap;
547 QMultiMap<int, QgsWidgetWrapper *> mDefaultValueDependencies;
553 QMultiMap<int, QgsWidgetWrapper *> mVirtualFieldsDependencies;
558 QSet<QgsEditorWidgetWrapper *> mRelatedLayerFieldsDependencies;
561 QList<int> mAlreadyUpdatedFields;
563 bool mNeedsGeometry =
false;
565 friend class TestQgsDualView;
566 friend class TestQgsAttributeForm;
This class contains context information for attribute editor widgets.
Single scope for storing variables and functions for use within a QgsExpressionContext.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...