QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
src
gui
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 <QWidget>
20
#include <QVariant>
21
#include "
qgseditorwidgetconfig.h
"
22
#include "
qgsattributeeditorcontext.h
"
23
#include "
qgssearchwidgetwrapper.h
"
24
25
class
QgsAttributeForm
;
26
class
QgsEditorWidgetWrapper
;
27
class
QgsMultiEditToolButton
;
28
class
QgsSearchWidgetToolButton
;
29
class
QgsVectorLayer
;
30
class
QStackedWidget
;
31
class
QgsAttributeEditorContext
;
32
41
class
GUI_EXPORT
QgsAttributeFormEditorWidget
:
public
QWidget
42
{
43
Q_OBJECT
44
45
public
:
46
48
enum
Mode
49
{
50
DefaultMode
,
51
MultiEditMode
,
52
SearchMode
,
53
};
54
59
explicit
QgsAttributeFormEditorWidget
(
QgsEditorWidgetWrapper
* editorWidget,
60
QgsAttributeForm
* form );
61
62
~
QgsAttributeFormEditorWidget
();
63
71
void
createSearchWidgetWrappers(
const
QString
& widgetId,
int
fieldIdx,
72
const
QgsEditorWidgetConfig
& config,
73
const
QgsAttributeEditorContext
&context =
QgsAttributeEditorContext
() );
74
80
void
setMode(
Mode
mode );
81
85
Mode
mode
()
const
{
return
mMode; }
86
91
void
initialize(
const
QVariant
& initialValue,
bool
mixedValues =
false
);
92
96
bool
hasChanged
()
const
{
return
mIsChanged; }
97
100
QVariant
currentValue()
const
;
101
106
QString
currentFilterExpression()
const
;
107
108
public
slots:
109
113
void
setIsMixed(
bool
mixed );
114
117
void
changesCommitted();
118
121
void
resetSearch();
122
123
signals:
124
127
void
valueChanged(
const
QVariant
& value );
128
129
private
slots:
130
132
void
editorWidgetChanged(
const
QVariant
& value );
133
135
void
resetValue();
136
138
void
setFieldTriggered();
139
141
void
searchWidgetFlagsChanged( QgsSearchWidgetWrapper::FilterFlags flags );
142
143
protected
:
144
149
QgsSearchWidgetToolButton
* searchWidgetToolButton();
150
159
void
setSearchWidgetWrapper(
QgsSearchWidgetWrapper
* wrapper );
160
166
QWidget
* searchWidgetFrame();
167
173
QList< QgsSearchWidgetWrapper* >
searchWidgetWrappers();
174
175
private
:
176
177
QWidget
* mEditPage;
178
QWidget
* mSearchPage;
179
QStackedWidget
* mStack;
180
QWidget
* mSearchFrame;
181
182
QgsEditorWidgetWrapper
* mWidget;
183
QList< QgsSearchWidgetWrapper* >
mSearchWidgets;
184
QgsAttributeForm
* mForm;
185
Mode
mMode;
186
187
QgsMultiEditToolButton
* mMultiEditButton;
188
QgsSearchWidgetToolButton
* mSearchWidgetToolButton;
189
QVariant
mPreviousValue;
190
bool
mBlockValueUpdate;
191
bool
mIsMixed;
192
bool
mIsChanged;
193
194
195
QgsVectorLayer
* layer();
196
void
updateWidgets();
197
};
198
199
#endif // QGSATTRIBUTEFORMEDITORWIDGET_H
qgsattributeeditorcontext.h
QgsSearchWidgetWrapper
Manages an editor widget Widget and wrapper share the same parent.
Definition:
qgssearchwidgetwrapper.h:40
QWidget
QgsAttributeFormEditorWidget::hasChanged
bool hasChanged() const
Returns true if the widget's value has been changed since it was initialized.
Definition:
qgsattributeformeditorwidget.h:96
QgsAttributeFormEditorWidget::MultiEditMode
Definition:
qgsattributeformeditorwidget.h:51
QgsAttributeEditorContext
This class contains context information for attribute editor widgets.
Definition:
qgsattributeeditorcontext.h:33
QgsEditorWidgetWrapper
Manages an editor widget Widget and wrapper share the same parent.
Definition:
qgseditorwidgetwrapper.h:41
QgsSearchWidgetToolButton
A tool button widget which is displayed next to search widgets in forms, and allows for controlling h...
Definition:
qgssearchwidgettoolbutton.h:29
QgsMultiEditToolButton
A tool button widget which is displayed next to editor widgets in attribute forms, and allows for controlling how the widget behaves and interacts with the form while in multi edit mode.
Definition:
qgsmultiedittoolbutton.h:29
QgsAttributeFormEditorWidget
A widget consisting of both an editor widget and additional widgets for controlling the behaviour of ...
Definition:
qgsattributeformeditorwidget.h:41
QgsEditorWidgetConfig
QVariantMap QgsEditorWidgetConfig
Holds a set of configuration parameters for a editor widget wrapper.
Definition:
qgseditorwidgetconfig.h:35
QgsAttributeFormEditorWidget::Mode
Mode
Widget modes.
Definition:
qgsattributeformeditorwidget.h:48
QStackedWidget
QString
QList
qgssearchwidgetwrapper.h
QgsAttributeForm
Definition:
qgsattributeform.h:37
QgsAttributeFormEditorWidget::SearchMode
Definition:
qgsattributeformeditorwidget.h:52
qgseditorwidgetconfig.h
QgsAttributeFormEditorWidget::mode
Mode mode() const
Returns the current mode for the widget.
Definition:
qgsattributeformeditorwidget.h:85
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition:
qgsvectorlayer.h:408
QgsAttributeFormEditorWidget::DefaultMode
Definition:
qgsattributeformeditorwidget.h:50
QVariant
Generated on Sun Jun 24 2018 11:42:48 for QGIS API Documentation by
1.8.13