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() );
310 void refreshFeature();
321 void parentFormValueChanged(
const QString &attribute,
const QVariant &newValue );
325 void onAttributeChanged(
const QVariant &value,
const QVariantList &additionalFieldValues );
326 void onAttributeAdded(
int idx );
327 void onAttributeDeleted(
int idx );
328 void onUpdatedFields();
329 void onConstraintStatusChanged(
const QString &constraint,
331 void preventFeatureRefresh();
332 void synchronizeEnabledState();
333 void layerSelectionChanged();
336 bool saveMultiEdits();
337 void resetMultiEdit(
bool promptToSave =
false );
338 void multiEditMessageClicked(
const QString &link );
340 void filterAndTriggered();
341 void filterOrTriggered();
342 void filterTriggered();
346 void searchSetSelection();
347 void searchAddToSelection();
348 void searchRemoveFromSelection();
349 void searchIntersectSelection();
360 bool fieldIsEditable(
int fieldIndex )
const;
364 void updateDefaultValueDependencies();
368 QWidget *widget =
nullptr;
372 bool labelOnTop =
false;
373 bool labelAlignRight =
false;
374 bool showLabel =
true;
385 void createWrappers();
386 void afterWidgetInit();
388 void scanForEqualAttributes(
QgsFeatureIterator &fit, QSet< int > &mixedValueFields, QHash< int, QVariant > &fieldSharedValues )
const;
394 void createDefaultValueDependencies();
397 bool updateDefaultValues(
const int originIdx );
399 int messageTimeout();
400 void clearMultiEditMessages();
401 void pushSelectedFeaturesMessage();
404 QString createFilterExpression()
const;
409 void updateAllConstraints();
411 void updateContainersVisibility();
414 bool currentFormValuesFeature(
QgsFeature &feature );
415 bool currentFormValidConstraints( QStringList &invalidFields, QStringList &descriptions );
424 bool mOwnsMessageBar;
427 QList<QgsWidgetWrapper *> mWidgets;
429 std::unique_ptr<QgsExpressionContextScope> mExtraContextScope;
430 QDialogButtonBox *mButtonBox =
nullptr;
431 QWidget *mSearchButtonBox =
nullptr;
432 QList<QgsAttributeFormInterface *> mInterfaces;
433 QMap< int, QgsAttributeFormEditorWidget * > mFormEditorWidgets;
434 QList< QgsAttributeFormWidget *> mFormWidgets;
435 QMap<const QgsVectorLayerJoinInfo *, QgsFeature> mJoinedFeatures;
436 QMap<QLabel *, QgsProperty> mLabelDataDefinedProperties;
437 bool mValuesInitialized =
false;
439 bool mIsSettingFeature =
false;
441 struct ContainerInformation
444 : tabWidget( tabWidget )
446 , expression( expression )
450 ContainerInformation( QWidget *widget,
const QgsExpression &expression )
452 , expression( expression )
457 QWidget *widget =
nullptr;
464 void registerContainerInformation( ContainerInformation *info );
468 void reloadIcon(
const QString &file,
const QString &tooltip, QSvgWidget *sw );
471 QVector<ContainerInformation *> mContainerVisibilityInformation;
472 QMap<QString, QVector<ContainerInformation *> > mContainerInformationDependency;
475 static int sFormCounter;
477 QString mPyFormVarName;
483 bool mPreventFeatureRefresh;
485 bool mIsSettingMultiEditFeatures;
488 bool mUnsavedMultiEditChanges;
490 QString mEditCommandMessage;
494 QMap<QWidget *, QSvgWidget *> mIconMap;
500 QMap<int, QgsWidgetWrapper *> mDefaultValueDependencies;
503 QList<int> mAlreadyUpdatedFields;
505 friend class TestQgsDualView;
506 friend class TestQgsAttributeForm;
509 #endif // QGSATTRIBUTEFORM_H