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;
309 void changeAttribute(
const QString &field,
const QVariant &value,
const QString &hintText = QString() );
370 void onAttributeChanged(
const QVariant &value,
const QVariantList &additionalFieldValues );
371 void onAttributeAdded(
int idx );
372 void onAttributeDeleted(
int idx );
373 void onRelatedFeaturesChanged();
374 void onUpdatedFields();
376 void preventFeatureRefresh();
377 void synchronizeState();
378 void layerSelectionChanged();
381 bool saveMultiEdits();
382 void resetMultiEdit(
bool promptToSave =
false );
383 void multiEditMessageClicked(
const QString &link );
385 void filterAndTriggered();
386 void filterOrTriggered();
387 void filterTriggered();
391 void searchSetSelection();
392 void searchAddToSelection();
393 void searchRemoveFromSelection();
394 void searchIntersectSelection();
405 bool fieldIsEditable(
int fieldIndex )
const;
409 void updateFieldDependencies();
415 void setMultiEditFeatureIdsRelations(
const QgsFeatureIds &fids );
419 QWidget *widget =
nullptr;
420 bool expandingNeeded =
false;
424 bool labelOnTop =
false;
425 bool labelAlignRight =
false;
426 bool showLabel =
true;
436 void createWrappers();
437 void afterWidgetInit();
439 void scanForEqualAttributes(
QgsFeatureIterator &fit, QSet<int> &mixedValueFields, QHash<int, QVariant> &fieldSharedValues )
const;
442 bool saveEdits( QString *error );
447 void updateValuesDependencies(
const int originIdx );
448 void updateValuesDependenciesDefaultValues(
const int originIdx );
449 void updateValuesDependenciesVirtualFields(
const int originIdx );
450 void updateValuesDependenciesParent();
451 void updateRelatedLayerFields();
453 void clearMultiEditMessages();
454 void pushSelectedFeaturesMessage();
457 QString createFilterExpression()
const;
462 void updateAllConstraints();
464 void updateContainersVisibility();
467 void updateEditableState();
468 bool currentFormValuesFeature(
QgsFeature &feature );
469 bool currentFormValidConstraints( QStringList &invalidFields, QStringList &descriptions )
const;
470 bool currentFormValidHardConstraints( QStringList &invalidFields, QStringList &descriptions )
const;
476 QToolButton *createCommentInfoButton( QWidget *labelWidget );
482 bool mOwnsMessageBar =
true;
485 QList<QgsWidgetWrapper *> mWidgets;
487 std::unique_ptr<QgsExpressionContextScope> mExtraContextScope;
488 QDialogButtonBox *mButtonBox =
nullptr;
489 QWidget *mSearchButtonBox =
nullptr;
490 QList<QgsAttributeFormInterface *> mInterfaces;
491 QMultiMap<int, QgsAttributeFormEditorWidget *> mFormEditorWidgets;
492 QList<QgsAttributeFormWidget *> mFormWidgets;
493 QMap<const QgsVectorLayerJoinInfo *, QgsFeature> mJoinedFeatures;
494 QMap<QLabel *, QgsProperty> mLabelDataDefinedProperties;
495 QMap<QWidget *, QgsProperty> mEditableDataDefinedProperties;
496 QMap<QWidget *, QgsProperty> mCustomCommentDataDefinedProperties;
497 bool mValuesInitialized =
false;
499 bool mIsSettingFeature =
false;
501 bool mValidConstraints =
true;
504 struct ContainerInformation
507 : tabWidget( tabWidget )
509 , expression( expression )
513 ContainerInformation( QWidget *widget,
const QgsExpression &expression )
515 , expression( expression )
519 ContainerInformation( QWidget *widget,
const QgsExpression &visibilityExpression,
bool collapsed,
const QgsExpression &collapsedExpression )
521 , expression( visibilityExpression )
523 , isCollapsed( collapsed )
524 , collapsedExpression( collapsedExpression )
528 QgsTabWidget *tabWidget =
nullptr;
529 QWidget *widget =
nullptr;
530 QgsExpression expression;
532 bool isCollapsed =
false;
533 QgsExpression collapsedExpression;
535 void apply( QgsExpressionContext *expressionContext );
538 void registerContainerInformation( ContainerInformation *info );
540 void updateIcon( QgsEditorWidgetWrapper *eww );
542 void reloadIcon(
const QString &file,
const QString &tooltip, QSvgWidget *sw );
545 QVector<ContainerInformation *> mContainerVisibilityCollapsedInformation;
546 QMap<QString, QVector<ContainerInformation *>> mContainerInformationDependency;
549 static int sFormCounter;
551 QString mPyFormVarName;
554 bool mIsSaving =
false;
557 bool mPreventFeatureRefresh =
false;
559 bool mIsSettingMultiEditFeatures =
false;
562 bool mUnsavedMultiEditChanges =
false;
564 QString mEditCommandMessage;
568 QMap<QWidget *, QSvgWidget *> mIconMap;
574 QMultiMap<int, QgsWidgetWrapper *> mDefaultValueDependencies;
580 QMultiMap<int, QgsWidgetWrapper *> mVirtualFieldsDependencies;
585 QSet<QgsEditorWidgetWrapper *> mRelatedLayerFieldsDependencies;
587 QSet<QgsEditorWidgetWrapper *> mParentDependencies;
590 QList<int> mAlreadyUpdatedFields;
592 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...