95 void displayWarning(
const QString &message );
103 void hideButtonBox();
111 void showButtonBox();
119 void disconnectButtonBox();
169 bool eventFilter( QObject *
object, QEvent *event )
override;
190 QString aggregateFilter()
const;
204 bool needsGeometry()
const;
285 void changeAttribute(
const QString &field,
const QVariant &value,
const QString &hintText = QString() );
292 void changeGeometry(
const QgsGeometry &geometry );
317 bool saveWithDetails( QString *error
SIP_OUT =
nullptr );
332 void refreshFeature();
343 void parentFormValueChanged(
const QString &attribute,
const QVariant &newValue );
346 void onAttributeChanged(
const QVariant &value,
const QVariantList &additionalFieldValues );
347 void onAttributeAdded(
int idx );
348 void onAttributeDeleted(
int idx );
349 void onRelatedFeaturesChanged();
350 void onUpdatedFields();
351 void onConstraintStatusChanged(
const QString &constraint,
353 void preventFeatureRefresh();
354 void synchronizeState();
355 void layerSelectionChanged();
358 bool saveMultiEdits();
359 void resetMultiEdit(
bool promptToSave =
false );
360 void multiEditMessageClicked(
const QString &link );
362 void filterAndTriggered();
363 void filterOrTriggered();
364 void filterTriggered();
368 void searchSetSelection();
369 void searchAddToSelection();
370 void searchRemoveFromSelection();
371 void searchIntersectSelection();
382 bool fieldIsEditable(
int fieldIndex )
const;
386 void updateFieldDependencies();
392 void setMultiEditFeatureIdsRelations(
const QgsFeatureIds &fids );
396 QWidget *widget =
nullptr;
400 bool labelOnTop =
false;
401 bool labelAlignRight =
false;
402 bool showLabel =
true;
412 void createWrappers();
413 void afterWidgetInit();
415 void scanForEqualAttributes(
QgsFeatureIterator &fit, QSet< int > &mixedValueFields, QHash< int, QVariant > &fieldSharedValues )
const;
418 bool saveEdits( QString *error );
423 void updateValuesDependencies(
const int originIdx );
424 void updateValuesDependenciesDefaultValues(
const int originIdx );
425 void updateValuesDependenciesVirtualFields(
const int originIdx );
426 void updateValuesDependenciesParent();
427 void updateRelatedLayerFields();
429 void clearMultiEditMessages();
430 void pushSelectedFeaturesMessage();
433 QString createFilterExpression()
const;
438 void updateAllConstraints();
440 void updateContainersVisibility();
443 void updateEditableState();
444 bool currentFormValuesFeature(
QgsFeature &feature );
445 bool currentFormValidConstraints( QStringList &invalidFields, QStringList &descriptions )
const;
446 bool currentFormValidHardConstraints( QStringList &invalidFields, QStringList &descriptions )
const;
456 bool mOwnsMessageBar;
459 QList<QgsWidgetWrapper *> mWidgets;
461 std::unique_ptr<QgsExpressionContextScope> mExtraContextScope;
462 QDialogButtonBox *mButtonBox =
nullptr;
463 QWidget *mSearchButtonBox =
nullptr;
464 QList<QgsAttributeFormInterface *> mInterfaces;
465 QMultiMap< int, QgsAttributeFormEditorWidget * > mFormEditorWidgets;
466 QList< QgsAttributeFormWidget *> mFormWidgets;
467 QMap<const QgsVectorLayerJoinInfo *, QgsFeature> mJoinedFeatures;
468 QMap<QLabel *, QgsProperty> mLabelDataDefinedProperties;
469 QMap<QWidget *, QgsProperty> mEditableDataDefinedProperties;
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;
560 QSet<QgsEditorWidgetWrapper *> mParentDependencies;
563 QList<int> mAlreadyUpdatedFields;
565 bool mNeedsGeometry =
false;
567 friend class TestQgsDualView;
568 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...