16 #ifndef QGSATTRIBUTEFORM_H
17 #define QGSATTRIBUTEFORM_H
26 #include <QDialogButtonBox>
92 void displayWarning(
const QString &message );
100 void hideButtonBox();
108 void showButtonBox();
116 void disconnectButtonBox();
168 bool eventFilter( QObject *
object, QEvent *event )
override;
192 QString aggregateFilter()
const;
280 void changeAttribute(
const QString &
field,
const QVariant &value,
const QString &hintText = QString() );
305 bool saveWithDetails( QString *error
SIP_OUT =
nullptr );
321 void refreshFeature();
332 void parentFormValueChanged(
const QString &attribute,
const QVariant &newValue );
338 bool needsGeometry()
const;
341 void onAttributeChanged(
const QVariant &value,
const QVariantList &additionalFieldValues );
342 void onAttributeAdded(
int idx );
343 void onAttributeDeleted(
int idx );
344 void onRelatedFeaturesChanged();
345 void onUpdatedFields();
346 void onConstraintStatusChanged(
const QString &constraint,
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();
388 QWidget *widget =
nullptr;
392 bool labelOnTop =
false;
393 bool labelAlignRight =
false;
394 bool showLabel =
true;
405 void createWrappers();
406 void afterWidgetInit();
408 void scanForEqualAttributes(
QgsFeatureIterator &fit, QSet< int > &mixedValueFields, QHash< int, QVariant > &fieldSharedValues )
const;
411 bool saveEdits( QString *error );
416 void updateValuesDependencies(
const int originIdx );
417 void updateValuesDependenciesDefaultValues(
const int originIdx );
418 void updateValuesDependenciesVirtualFields(
const int originIdx );
419 void updateRelatedLayerFields();
421 void clearMultiEditMessages();
422 void pushSelectedFeaturesMessage();
425 QString createFilterExpression()
const;
430 void updateAllConstraints();
432 void updateContainersVisibility();
435 bool currentFormValuesFeature(
QgsFeature &feature );
436 bool currentFormValidConstraints( QStringList &invalidFields, QStringList &descriptions )
const;
437 bool currentFormValidHardConstraints( QStringList &invalidFields, QStringList &descriptions )
const;
447 bool mOwnsMessageBar;
450 QList<QgsWidgetWrapper *> mWidgets;
452 std::unique_ptr<QgsExpressionContextScope> mExtraContextScope;
453 QDialogButtonBox *mButtonBox =
nullptr;
454 QWidget *mSearchButtonBox =
nullptr;
455 QList<QgsAttributeFormInterface *> mInterfaces;
456 QMap< int, QgsAttributeFormEditorWidget * > mFormEditorWidgets;
457 QList< QgsAttributeFormWidget *> mFormWidgets;
458 QMap<const QgsVectorLayerJoinInfo *, QgsFeature> mJoinedFeatures;
459 QMap<QLabel *, QgsProperty> mLabelDataDefinedProperties;
460 bool mValuesInitialized =
false;
462 bool mIsSettingFeature =
false;
464 bool mValidConstraints =
true;
467 struct ContainerInformation
470 : tabWidget( tabWidget )
472 , expression( expression )
476 ContainerInformation( QWidget *widget,
const QgsExpression &expression )
478 , expression( expression )
483 QWidget *widget =
nullptr;
490 void registerContainerInformation( ContainerInformation *info );
494 void reloadIcon(
const QString &file,
const QString &tooltip, QSvgWidget *sw );
497 QVector<ContainerInformation *> mContainerVisibilityInformation;
498 QMap<QString, QVector<ContainerInformation *> > mContainerInformationDependency;
501 static int sFormCounter;
503 QString mPyFormVarName;
509 bool mPreventFeatureRefresh;
511 bool mIsSettingMultiEditFeatures;
514 bool mUnsavedMultiEditChanges;
516 QString mEditCommandMessage;
520 QMap<QWidget *, QSvgWidget *> mIconMap;
526 QMap<int, QgsWidgetWrapper *> mDefaultValueDependencies;
532 QMap<int, QgsWidgetWrapper *> mVirtualFieldsDependencies;
537 QSet<QgsEditorWidgetWrapper *> mRelatedLayerFieldsDependencies;
540 QList<int> mAlreadyUpdatedFields;
542 bool mNeedsGeometry =
false;
544 friend class TestQgsDualView;
545 friend class TestQgsAttributeForm;
SelectBehavior
Specifies how a selection should be applied.
This class contains context information for attribute editor widgets.
This is an abstract base class for any elements of a drag and drop form.
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...
Class for parsing and evaluation of expressions (formerly called "search strings").
Wrapper for iterator of features from vector data provider or vector layer.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Represents an item shown within a QgsMessageBar widget.
A bar for displaying non-blocking messages to the user.
Represents a vector layer which manages a vector based data sets.
QSet< QgsFeatureId > QgsFeatureIds
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features