16 #ifndef QGSATTRIBUTEFORM_H
17 #define QGSATTRIBUTEFORM_H
27 #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 );
336 void onAttributeChanged(
const QVariant &value,
const QVariantList &additionalFieldValues );
337 void onAttributeAdded(
int idx );
338 void onAttributeDeleted(
int idx );
339 void onUpdatedFields();
340 void onConstraintStatusChanged(
const QString &constraint,
342 void preventFeatureRefresh();
343 void synchronizeState();
344 void layerSelectionChanged();
347 bool saveMultiEdits();
348 void resetMultiEdit(
bool promptToSave =
false );
349 void multiEditMessageClicked(
const QString &link );
351 void filterAndTriggered();
352 void filterOrTriggered();
353 void filterTriggered();
357 void searchSetSelection();
358 void searchAddToSelection();
359 void searchRemoveFromSelection();
360 void searchIntersectSelection();
371 bool fieldIsEditable(
int fieldIndex )
const;
375 void updateDefaultValueDependencies();
379 QWidget *widget =
nullptr;
383 bool labelOnTop =
false;
384 bool labelAlignRight =
false;
385 bool showLabel =
true;
396 void createWrappers();
397 void afterWidgetInit();
399 void scanForEqualAttributes(
QgsFeatureIterator &fit, QSet< int > &mixedValueFields, QHash< int, QVariant > &fieldSharedValues )
const;
402 bool saveEdits( QString *error );
405 void createDefaultValueDependencies();
408 bool updateDefaultValues(
const int originIdx );
410 void clearMultiEditMessages();
411 void pushSelectedFeaturesMessage();
414 QString createFilterExpression()
const;
419 void updateAllConstraints();
421 void updateContainersVisibility();
424 bool currentFormValuesFeature(
QgsFeature &feature );
425 bool currentFormValidConstraints( QStringList &invalidFields, QStringList &descriptions );
435 bool mOwnsMessageBar;
438 QList<QgsWidgetWrapper *> mWidgets;
440 std::unique_ptr<QgsExpressionContextScope> mExtraContextScope;
441 QDialogButtonBox *mButtonBox =
nullptr;
442 QWidget *mSearchButtonBox =
nullptr;
443 QList<QgsAttributeFormInterface *> mInterfaces;
444 QMap< int, QgsAttributeFormEditorWidget * > mFormEditorWidgets;
445 QList< QgsAttributeFormWidget *> mFormWidgets;
446 QMap<const QgsVectorLayerJoinInfo *, QgsFeature> mJoinedFeatures;
447 QMap<QLabel *, QgsProperty> mLabelDataDefinedProperties;
448 bool mValuesInitialized =
false;
450 bool mIsSettingFeature =
false;
452 bool mValidConstraints =
true;
455 struct ContainerInformation
458 : tabWidget( tabWidget )
460 , expression( expression )
464 ContainerInformation( QWidget *widget,
const QgsExpression &expression )
466 , expression( expression )
471 QWidget *widget =
nullptr;
478 void registerContainerInformation( ContainerInformation *info );
482 void reloadIcon(
const QString &file,
const QString &tooltip, QSvgWidget *sw );
485 QVector<ContainerInformation *> mContainerVisibilityInformation;
486 QMap<QString, QVector<ContainerInformation *> > mContainerInformationDependency;
489 static int sFormCounter;
491 QString mPyFormVarName;
497 bool mPreventFeatureRefresh;
499 bool mIsSettingMultiEditFeatures;
502 bool mUnsavedMultiEditChanges;
504 QString mEditCommandMessage;
508 QMap<QWidget *, QSvgWidget *> mIconMap;
514 QMap<int, QgsWidgetWrapper *> mDefaultValueDependencies;
517 QList<int> mAlreadyUpdatedFields;
519 friend class TestQgsDualView;
520 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...
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.
SelectBehavior
Selection behavior.
QSet< QgsFeatureId > QgsFeatureIds
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features