96 void displayWarning(
const QString &message );
104 void hideButtonBox();
112 void showButtonBox();
120 void disconnectButtonBox();
170 bool eventFilter( QObject *
object, QEvent *event )
override;
191 QString aggregateFilter()
const;
205 bool needsGeometry()
const;
303 void changeAttribute(
const QString &field,
const QVariant &value,
const QString &hintText = QString() );
364 void onAttributeChanged(
const QVariant &value,
const QVariantList &additionalFieldValues );
365 void onAttributeAdded(
int idx );
366 void onAttributeDeleted(
int idx );
367 void onRelatedFeaturesChanged();
368 void onUpdatedFields();
370 void preventFeatureRefresh();
371 void synchronizeState();
372 void layerSelectionChanged();
375 bool saveMultiEdits();
376 void resetMultiEdit(
bool promptToSave =
false );
377 void multiEditMessageClicked(
const QString &link );
379 void filterAndTriggered();
380 void filterOrTriggered();
381 void filterTriggered();
385 void searchSetSelection();
386 void searchAddToSelection();
387 void searchRemoveFromSelection();
388 void searchIntersectSelection();
399 bool fieldIsEditable(
int fieldIndex )
const;
403 void updateFieldDependencies();
409 void setMultiEditFeatureIdsRelations(
const QgsFeatureIds &fids );
413 QWidget *widget =
nullptr;
414 bool expandingNeeded =
false;
418 bool labelOnTop =
false;
419 bool labelAlignRight =
false;
420 bool showLabel =
true;
430 void createWrappers();
431 void afterWidgetInit();
433 void scanForEqualAttributes(
QgsFeatureIterator &fit, QSet<int> &mixedValueFields, QHash<int, QVariant> &fieldSharedValues )
const;
436 bool saveEdits( QString *error );
441 void updateValuesDependencies(
const int originIdx );
442 void updateValuesDependenciesDefaultValues(
const int originIdx );
443 void updateValuesDependenciesVirtualFields(
const int originIdx );
444 void updateValuesDependenciesParent();
445 void updateRelatedLayerFields();
447 void clearMultiEditMessages();
448 void pushSelectedFeaturesMessage();
451 QString createFilterExpression()
const;
456 void updateAllConstraints();
458 void updateContainersVisibility();
461 void updateEditableState();
462 bool currentFormValuesFeature(
QgsFeature &feature );
463 bool currentFormValidConstraints( QStringList &invalidFields, QStringList &descriptions )
const;
464 bool currentFormValidHardConstraints( QStringList &invalidFields, QStringList &descriptions )
const;
470 QToolButton *createCommentInfoButton( QWidget *labelWidget );
476 bool mOwnsMessageBar =
true;
479 QList<QgsWidgetWrapper *> mWidgets;
481 std::unique_ptr<QgsExpressionContextScope> mExtraContextScope;
482 QDialogButtonBox *mButtonBox =
nullptr;
483 QWidget *mSearchButtonBox =
nullptr;
484 QList<QgsAttributeFormInterface *> mInterfaces;
485 QMultiMap<int, QgsAttributeFormEditorWidget *> mFormEditorWidgets;
486 QList<QgsAttributeFormWidget *> mFormWidgets;
487 QMap<const QgsVectorLayerJoinInfo *, QgsFeature> mJoinedFeatures;
488 QMap<QLabel *, QgsProperty> mLabelDataDefinedProperties;
489 QMap<QWidget *, QgsProperty> mEditableDataDefinedProperties;
490 QMap<QWidget *, QgsProperty> mCustomCommentDataDefinedProperties;
491 bool mValuesInitialized =
false;
493 bool mIsSettingFeature =
false;
495 bool mValidConstraints =
true;
498 struct ContainerInformation
501 : tabWidget( tabWidget )
503 , expression( expression )
507 ContainerInformation( QWidget *widget,
const QgsExpression &expression )
509 , expression( expression )
513 ContainerInformation( QWidget *widget,
const QgsExpression &visibilityExpression,
bool collapsed,
const QgsExpression &collapsedExpression )
515 , expression( visibilityExpression )
517 , isCollapsed( collapsed )
518 , collapsedExpression( collapsedExpression )
522 QgsTabWidget *tabWidget =
nullptr;
523 QWidget *widget =
nullptr;
524 QgsExpression expression;
526 bool isCollapsed =
false;
527 QgsExpression collapsedExpression;
529 void apply( QgsExpressionContext *expressionContext );
532 void registerContainerInformation( ContainerInformation *info );
534 void updateIcon( QgsEditorWidgetWrapper *eww );
536 void reloadIcon(
const QString &file,
const QString &tooltip, QSvgWidget *sw );
539 QVector<ContainerInformation *> mContainerVisibilityCollapsedInformation;
540 QMap<QString, QVector<ContainerInformation *>> mContainerInformationDependency;
543 static int sFormCounter;
545 QString mPyFormVarName;
548 bool mIsSaving =
false;
551 bool mPreventFeatureRefresh =
false;
553 bool mIsSettingMultiEditFeatures =
false;
556 bool mUnsavedMultiEditChanges =
false;
558 QString mEditCommandMessage;
562 QMap<QWidget *, QSvgWidget *> mIconMap;
568 QMultiMap<int, QgsWidgetWrapper *> mDefaultValueDependencies;
574 QMultiMap<int, QgsWidgetWrapper *> mVirtualFieldsDependencies;
579 QSet<QgsEditorWidgetWrapper *> mRelatedLayerFieldsDependencies;
581 QSet<QgsEditorWidgetWrapper *> mParentDependencies;
584 QList<int> mAlreadyUpdatedFields;
586 bool mNeedsGeometry =
false;
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...