QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsattributeformeditorwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsattributeformeditorwidget.h
3 -----------------------------
4 Date : March 2016
5 Copyright : (C) 2016 Nyall Dawson
6 Email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSATTRIBUTEFORMEDITORWIDGET_H
17#define QGSATTRIBUTEFORMEDITORWIDGET_H
18
19#include "qgis_gui.h"
20#include "qgis_sip.h"
23
27class QgsVectorLayer;
28class QStackedWidget;
30class QLabel;
32
33class QToolButton;
34
46{
47 Q_OBJECT
48
49 public:
58
60
62
69 void initialize( const QVariant &initialValue, bool mixedValues = false, const QVariantList &additionalFieldValues = QVariantList() );
70
75 bool hasChanged() const { return mIsChanged; }
76
80 QVariant currentValue() const;
81
85 void setConstraintStatus( const QString &constraint, const QString &description, const QString &err, QgsEditorWidgetWrapper::ConstraintResult result );
86
90 void setConstraintResultVisible( bool editable );
91
97 void setRememberLastValue( bool remember );
98
103 QgsEditorWidgetWrapper *editorWidget() const;
104
105 public slots:
106
111 void setIsMixed( bool mixed );
112
116 void changesCommitted();
117
118 signals:
119
125 Q_DECL_DEPRECATED void valueChanged( const QVariant &value );
126
133 void valuesChanged( const QVariant &value, const QVariantList &additionalFieldValues );
134
141 void rememberLastValueChanged( int index, bool remember );
142
143 private slots:
144
146 void editorWidgetValuesChanged( const QVariant &value, const QVariantList &additionalFieldValues );
147
149 void resetValue();
150
152 void setFieldTriggered();
153
154 void onAggregateChanged();
155
156 private:
157 QString mWidgetType;
158 QgsEditorWidgetWrapper *mEditorWidget = nullptr;
159 QgsAttributeForm *mForm = nullptr;
160 QLabel *mConstraintResultLabel = nullptr;
161
162 QToolButton *mRememberLastValueButton = nullptr;
163 QgsMultiEditToolButton *mMultiEditButton = nullptr;
164 QgsAggregateToolButton *mAggregateButton = nullptr;
165 QVariant mPreviousValue;
166 QVariantList mPreviousAdditionalValues;
167 bool mBlockValueUpdate = false;
168 bool mIsMixed = false;
169 bool mIsChanged = false;
170 bool mIsConstraintResultVisible = false;
171
172 void updateWidgets() final;
173 void updateRememberWidget();
174
176};
177
178#endif // QGSATTRIBUTEFORMEDITORWIDGET_H
Offers a toolbutton to choose between different aggregate functions.
Contains context information for attribute editor widgets.
QgsAttributeFormEditorWidget(QgsEditorWidgetWrapper *editorWidget, const QString &widgetType, QgsAttributeForm *form)
Constructor for QgsAttributeFormEditorWidget.
void initialize(const QVariant &initialValue, bool mixedValues=false, const QVariantList &additionalFieldValues=QVariantList())
Resets the widget to an initial value.
bool hasChanged() const
Returns true if the widget's value has been changed since it was initialized.
void valuesChanged(const QVariant &value, const QVariantList &additionalFieldValues)
Emitted when the widget's value changes.
Q_DECL_DEPRECATED void valueChanged(const QVariant &value)
Emitted when the widget's value changes.
void rememberLastValueChanged(int index, bool remember)
Emitted when the widget's remember last value toggle changes.
QgsEditorWidgetWrapper * editorWidget() const
Returns the editor widget wrapper.
QgsAttributeForm * form() const
The form on which this widget is shown.
virtual void createSearchWidgetWrappers(const QgsAttributeEditorContext &context=QgsAttributeEditorContext())=0
Creates the search widget wrappers for the widget used when the form is in search mode.
QgsAttributeFormWidget(QgsWidgetWrapper *widget, QgsAttributeForm *form)
A new form widget for the wrapper widget on form.
The attribute form widget for vector layer features.
Manages an editor widget.
ConstraintResult
Result of constraint checks.
A tool button for controlling how edits to multiple features are applied.
A tool button widget which is displayed next to search widgets in forms, and allows for controlling h...
Represents a vector layer which manages a vector based dataset.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53