QGIS API Documentation 3.99.0-Master (26c88405ac0)
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:
50
59
61
63
70 void initialize( const QVariant &initialValue, bool mixedValues = false, const QVariantList &additionalFieldValues = QVariantList() );
71
76 bool hasChanged() const { return mIsChanged; }
77
81 QVariant currentValue() const;
82
86 void setConstraintStatus( const QString &constraint, const QString &description, const QString &err, QgsEditorWidgetWrapper::ConstraintResult result );
87
91 void setConstraintResultVisible( bool editable );
92
98 void setRememberLastValue( bool remember );
99
104 QgsEditorWidgetWrapper *editorWidget() const;
105
106 public slots:
107
112 void setIsMixed( bool mixed );
113
117 void changesCommitted();
118
119 signals:
120
126 Q_DECL_DEPRECATED void valueChanged( const QVariant &value );
127
134 void valuesChanged( const QVariant &value, const QVariantList &additionalFieldValues );
135
142 void rememberLastValueChanged( int index, bool remember );
143
144 private slots:
145
147 void editorWidgetValuesChanged( const QVariant &value, const QVariantList &additionalFieldValues );
148
150 void resetValue();
151
153 void setFieldTriggered();
154
155 void onAggregateChanged();
156
157 private:
158 QString mWidgetType;
159 QgsEditorWidgetWrapper *mEditorWidget = nullptr;
160 QgsAttributeForm *mForm = nullptr;
161 QLabel *mConstraintResultLabel = nullptr;
162
163 QToolButton *mRememberLastValueButton = nullptr;
164 QgsMultiEditToolButton *mMultiEditButton = nullptr;
165 QgsAggregateToolButton *mAggregateButton = nullptr;
166 QVariant mPreviousValue;
167 QVariantList mPreviousAdditionalValues;
168 bool mBlockValueUpdate;
169 bool mIsMixed;
170 bool mIsChanged;
171 bool mIsConstraintResultVisible = false;
172
173 void updateWidgets() final;
174 void updateRememberWidget();
175
177};
178
179#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