16 #ifndef QGSATTRIBUTEFORM_H
17 #define QGSATTRIBUTEFORM_H
27 #include <QDialogButtonBox>
84 void displayWarning(
const QString &message );
100 void showButtonBox();
108 void disconnectButtonBox();
160 bool eventFilter( QObject *
object, QEvent *event )
override;
184 QString aggregateFilter()
const;
196 Q_DECL_DEPRECATED
void attributeChanged(
const QString &attribute,
const QVariant &value )
SIP_DEPRECATED;
206 void widgetValueChanged(
const QString &attribute,
const QVariant &value,
bool attributeChanged );
216 void beforeSave(
bool &ok )
SIP_SKIP;
221 void featureSaved(
const QgsFeature &feature );
247 void zoomToFeatures(
const QString &filter );
253 void flashFeatures(
const QString &filter );
264 void changeAttribute(
const QString &field,
const QVariant &value,
const QString &hintText = QString() );
294 void refreshFeature();
305 void parentFormValueChanged(
const QString &attribute,
const QVariant &newValue );
309 void onAttributeChanged(
const QVariant &value,
const QVariantList &additionalFieldValues );
310 void onAttributeAdded(
int idx );
311 void onAttributeDeleted(
int idx );
312 void onUpdatedFields();
313 void onConstraintStatusChanged(
const QString &constraint,
315 void preventFeatureRefresh();
316 void synchronizeEnabledState();
317 void layerSelectionChanged();
320 bool saveMultiEdits();
321 void resetMultiEdit(
bool promptToSave =
false );
322 void multiEditMessageClicked(
const QString &link );
324 void filterAndTriggered();
325 void filterOrTriggered();
326 void filterTriggered();
330 void searchSetSelection();
331 void searchAddToSelection();
332 void searchRemoveFromSelection();
333 void searchIntersectSelection();
344 bool fieldIsEditable(
int fieldIndex )
const;
348 void updateDefaultValueDependencies();
352 QWidget *widget =
nullptr;
356 bool labelOnTop =
false;
357 bool labelAlignRight =
false;
358 bool showLabel =
true;
369 void createWrappers();
370 void afterWidgetInit();
372 void scanForEqualAttributes(
QgsFeatureIterator &fit, QSet< int > &mixedValueFields, QHash< int, QVariant > &fieldSharedValues )
const;
378 void createDefaultValueDependencies();
381 bool updateDefaultValues(
const int originIdx );
383 int messageTimeout();
384 void clearMultiEditMessages();
385 void pushSelectedFeaturesMessage();
388 QString createFilterExpression()
const;
391 void updateAllConstraints();
393 void updateContainersVisibility();
396 bool currentFormFeature(
QgsFeature &feature );
397 bool currentFormValidConstraints( QStringList &invalidFields, QStringList &descriptions );
405 bool mOwnsMessageBar;
408 QList<QgsWidgetWrapper *> mWidgets;
410 QDialogButtonBox *mButtonBox =
nullptr;
411 QWidget *mSearchButtonBox =
nullptr;
412 QList<QgsAttributeFormInterface *> mInterfaces;
413 QMap< int, QgsAttributeFormEditorWidget * > mFormEditorWidgets;
414 QList< QgsAttributeFormWidget *> mFormWidgets;
415 QMap<const QgsVectorLayerJoinInfo *, QgsFeature> mJoinedFeatures;
416 QMap<QLabel *, QgsProperty> mLabelDataDefinedProperties;
417 bool mValuesInitialized =
false;
419 bool mIsSettingFeature =
false;
421 struct ContainerInformation
424 : tabWidget( tabWidget )
426 , expression( expression )
430 ContainerInformation( QWidget *widget,
const QgsExpression &expression )
432 , expression( expression )
437 QWidget *widget =
nullptr;
444 void registerContainerInformation( ContainerInformation *info );
448 void reloadIcon(
const QString &file,
const QString &tooltip, QSvgWidget *sw );
451 QVector<ContainerInformation *> mContainerVisibilityInformation;
452 QMap<QString, QVector<ContainerInformation *> > mContainerInformationDependency;
455 static int sFormCounter;
457 QString mPyFormVarName;
463 bool mPreventFeatureRefresh;
465 bool mIsSettingMultiEditFeatures;
468 bool mUnsavedMultiEditChanges;
470 QString mEditCommandMessage;
474 QMap<QWidget *, QSvgWidget *> mIconMap;
480 QMap<int, QgsWidgetWrapper *> mDefaultValueDependencies;
483 QList<int> mAlreadyUpdatedFields;
485 friend class TestQgsDualView;
486 friend class TestQgsAttributeForm;
489 #endif // QGSATTRIBUTEFORM_H