QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsattributeformwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsattributeformwidget.h
3 ---------------------
4 begin : November 2017
5 copyright : (C) 2017 by Matthias Kuhn
6 email : matthias at opengis dot ch
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#ifndef QGSATTRIBUTEFORMWIDGET_H
16#define QGSATTRIBUTEFORMWIDGET_H
17
18#include "qgis_gui.h"
19#include "qgis_sip.h"
22
23#include <QVariant>
24#include <QWidget>
25
27class QStackedWidget;
29
37class GUI_EXPORT QgsAttributeFormWidget : public QWidget // SIP_ABSTRACT
38{
39 Q_OBJECT
40
41 public:
50
55
56 ~QgsAttributeFormWidget() override;
57
65
70 virtual QString currentFilterExpression() const;
71
72
79 void setMode( Mode mode );
80
85 Mode mode() const { return mMode; }
86
90 QgsVectorLayer *layer();
91
95 QgsAttributeForm *form() const;
96
103 QWidget *searchWidgetFrame() SIP_SKIP;
104
105
115 void setSearchWidgetWrapper( QgsSearchWidgetWrapper *wrapper );
116
121 void addAdditionalSearchWidgetWrapper( QgsSearchWidgetWrapper *wrapper );
122
129 QList<QgsSearchWidgetWrapper *> searchWidgetWrappers();
130
134 void resetSearch();
135
140 bool searchWidgetToolButtonVisible() const;
141
146 void setSearchWidgetToolButtonVisible( bool searchWidgetToolButtonVisible );
147
148 protected:
155 QWidget *editPage() const SIP_SKIP;
156
163 QStackedWidget *stack() const SIP_SKIP;
164
171 QWidget *searchPage() const SIP_SKIP;
172
178 void setVisiblePageForMode( QgsAttributeFormWidget::Mode mode );
179
180 private slots:
181
183 void searchWidgetFlagsChanged( QgsSearchWidgetWrapper::FilterFlags flags );
184
185 private:
186 virtual void updateWidgets();
187 QgsAttributeFormWidget::Mode mMode = DefaultMode;
188 QgsSearchWidgetToolButton *mSearchWidgetToolButton = nullptr;
189 QWidget *mEditPage = nullptr;
190 QWidget *mSearchPage = nullptr;
191 QStackedWidget *mStack = nullptr;
192 QWidget *mSearchFrame = nullptr;
193 QgsAttributeForm *mForm = nullptr;
194 QList<QgsSearchWidgetWrapper *> mSearchWidgets;
195 QgsWidgetWrapper *mWidget = nullptr;
196};
197
198#endif // QGSATTRIBUTEFORMWIDGET_H
Contains context information for attribute editor widgets.
Base class for all widgets shown on a QgsAttributeForm.
void setMode(Mode mode)
Sets the current mode for the widget.
Mode mode() const
Returns the current mode for the widget.
virtual void createSearchWidgetWrappers(const QgsAttributeEditorContext &context=QgsAttributeEditorContext())=0
Creates the search widget wrappers for the widget used when the form is in search mode.
virtual QString currentFilterExpression() const
Creates an expression matching the current search filter value and search properties represented in t...
@ SearchMode
Layer search/filter mode.
@ MultiEditMode
Multi edit mode, both the editor widget and a QgsMultiEditToolButton is shown.
@ DefaultMode
Default mode, only the editor widget is shown.
@ AggregateSearchMode
Embedded in a search form, show additional aggregate function toolbutton.
QgsAttributeFormWidget(QgsWidgetWrapper *widget, QgsAttributeForm *form)
A new form widget for the wrapper widget on form.
The attribute form widget for vector layer features.
A tool button widget which is displayed next to search widgets in forms, and allows for controlling h...
Shows a search widget on a filter form.
Represents a vector layer which manages a vector based dataset.
Manages an editor widget.
#define SIP_SKIP
Definition qgis_sip.h:134
#define SIP_PYARGREMOVE
Definition qgis_sip.h:159