91 void displayWarning(
const QString &message );
107 void showButtonBox();
115 void disconnectButtonBox();
165 bool eventFilter( QObject *
object, QEvent *event )
override;
186 QString aggregateFilter()
const;
200 bool needsGeometry()
const;
281 void changeAttribute(
const QString &field,
const QVariant &value,
const QString &hintText = QString() );
288 void changeGeometry(
const QgsGeometry &geometry );
313 bool saveWithDetails( QString *error
SIP_OUT =
nullptr );
328 void refreshFeature();
339 void parentFormValueChanged(
const QString &attribute,
const QVariant &newValue );
342 void onAttributeChanged(
const QVariant &value,
const QVariantList &additionalFieldValues );
343 void onAttributeAdded(
int idx );
344 void onAttributeDeleted(
int idx );
345 void onRelatedFeaturesChanged();
346 void onUpdatedFields();
348 void preventFeatureRefresh();
349 void synchronizeState();
350 void layerSelectionChanged();
353 bool saveMultiEdits();
354 void resetMultiEdit(
bool promptToSave =
false );
355 void multiEditMessageClicked(
const QString &link );
357 void filterAndTriggered();
358 void filterOrTriggered();
359 void filterTriggered();
363 void searchSetSelection();
364 void searchAddToSelection();
365 void searchRemoveFromSelection();
366 void searchIntersectSelection();
377 bool fieldIsEditable(
int fieldIndex )
const;
381 void updateFieldDependencies();
387 void setMultiEditFeatureIdsRelations(
const QgsFeatureIds &fids );
391 QWidget *widget =
nullptr;
395 bool labelOnTop =
false;
396 bool labelAlignRight =
false;
397 bool showLabel =
true;
407 void createWrappers();
408 void afterWidgetInit();
410 void scanForEqualAttributes(
QgsFeatureIterator &fit, QSet<int> &mixedValueFields, QHash<int, QVariant> &fieldSharedValues )
const;
413 bool saveEdits( QString *error );
418 void updateValuesDependencies(
const int originIdx );
419 void updateValuesDependenciesDefaultValues(
const int originIdx );
420 void updateValuesDependenciesVirtualFields(
const int originIdx );
421 void updateValuesDependenciesParent();
422 void updateRelatedLayerFields();
424 void clearMultiEditMessages();
425 void pushSelectedFeaturesMessage();
428 QString createFilterExpression()
const;
433 void updateAllConstraints();
435 void updateContainersVisibility();
438 void updateEditableState();
439 bool currentFormValuesFeature(
QgsFeature &feature );
440 bool currentFormValidConstraints( QStringList &invalidFields, QStringList &descriptions )
const;
441 bool currentFormValidHardConstraints( QStringList &invalidFields, QStringList &descriptions )
const;
451 bool mOwnsMessageBar;
454 QList<QgsWidgetWrapper *> mWidgets;
456 std::unique_ptr<QgsExpressionContextScope> mExtraContextScope;
457 QDialogButtonBox *mButtonBox =
nullptr;
458 QWidget *mSearchButtonBox =
nullptr;
459 QList<QgsAttributeFormInterface *> mInterfaces;
460 QMultiMap<int, QgsAttributeFormEditorWidget *> mFormEditorWidgets;
461 QList<QgsAttributeFormWidget *> mFormWidgets;
462 QMap<const QgsVectorLayerJoinInfo *, QgsFeature> mJoinedFeatures;
463 QMap<QLabel *, QgsProperty> mLabelDataDefinedProperties;
464 QMap<QWidget *, QgsProperty> mEditableDataDefinedProperties;
465 bool mValuesInitialized =
false;
467 bool mIsSettingFeature =
false;
469 bool mValidConstraints =
true;
472 struct ContainerInformation
475 : tabWidget( tabWidget )
477 , expression( expression )
481 ContainerInformation( QWidget *widget,
const QgsExpression &expression )
483 , expression( expression )
487 ContainerInformation( QWidget *widget,
const QgsExpression &visibilityExpression,
bool collapsed,
const QgsExpression &collapsedExpression )
489 , expression( visibilityExpression )
491 , isCollapsed( collapsed )
492 , collapsedExpression( collapsedExpression )
497 QWidget *widget =
nullptr;
500 bool isCollapsed =
false;
506 void registerContainerInformation( ContainerInformation *info );
510 void reloadIcon(
const QString &file,
const QString &tooltip, QSvgWidget *sw );
513 QVector<ContainerInformation *> mContainerVisibilityCollapsedInformation;
514 QMap<QString, QVector<ContainerInformation *>> mContainerInformationDependency;
517 static int sFormCounter;
519 QString mPyFormVarName;
525 bool mPreventFeatureRefresh;
527 bool mIsSettingMultiEditFeatures;
530 bool mUnsavedMultiEditChanges;
532 QString mEditCommandMessage;
536 QMap<QWidget *, QSvgWidget *> mIconMap;
542 QMultiMap<int, QgsWidgetWrapper *> mDefaultValueDependencies;
548 QMultiMap<int, QgsWidgetWrapper *> mVirtualFieldsDependencies;
553 QSet<QgsEditorWidgetWrapper *> mRelatedLayerFieldsDependencies;
555 QSet<QgsEditorWidgetWrapper *> mParentDependencies;
558 QList<int> mAlreadyUpdatedFields;
560 bool mNeedsGeometry =
false;
562 friend class TestQgsDualView;
563 friend class TestQgsAttributeForm;
564 friend class TestQgsValueRelationWidgetWrapper;
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...