QGIS API Documentation
3.4.15-Madeira (e83d02e274)
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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 "
qgis_sip.h
"
20
#include "qgis_gui.h"
21
#include "
qgseditorwidgetwrapper.h
"
22
#include "
qgsattributeformwidget.h
"
23
24
class
QgsEditorWidgetWrapper
;
25
class
QgsMultiEditToolButton
;
26
class
QgsSearchWidgetToolButton
;
27
class
QgsVectorLayer
;
28
class
QStackedWidget;
29
class
QgsAttributeEditorContext
;
30
class
QLabel;
31
class
QgsAggregateToolButton
;
32
42
class
GUI_EXPORT
QgsAttributeFormEditorWidget
:
public
QgsAttributeFormWidget
43
{
44
Q_OBJECT
45
46
public
:
47
55
explicit
QgsAttributeFormEditorWidget
(
QgsEditorWidgetWrapper
*editorWidget,
const
QString &widgetType,
56
QgsAttributeForm
*form
SIP_TRANSFERTHIS
);
57
58
~
QgsAttributeFormEditorWidget
()
override
;
59
60
void
createSearchWidgetWrappers
(
const
QgsAttributeEditorContext
&context =
QgsAttributeEditorContext
() )
override
;
61
67
void
initialize(
const
QVariant &initialValue,
bool
mixedValues =
false
);
68
73
bool
hasChanged
()
const
{
return
mIsChanged; }
74
78
QVariant currentValue()
const
;
79
83
void
setConstraintStatus(
const
QString &constraint,
const
QString &description,
const
QString &err,
QgsEditorWidgetWrapper::ConstraintResult
result );
84
88
void
setConstraintResultVisible(
bool
editable );
89
90
public
slots:
91
96
void
setIsMixed(
bool
mixed );
97
101
void
changesCommitted();
102
103
signals:
104
109
void
valueChanged(
const
QVariant &value );
110
111
private
slots:
112
114
void
editorWidgetChanged(
const
QVariant &value );
115
117
void
resetValue();
118
120
void
setFieldTriggered();
121
122
void
onAggregateChanged();
123
124
private
:
125
QString mWidgetType;
126
QgsEditorWidgetWrapper
*mWidget =
nullptr
;
127
QgsAttributeForm
*mForm =
nullptr
;
128
QLabel *mConstraintResultLabel =
nullptr
;
129
130
QgsMultiEditToolButton
*mMultiEditButton =
nullptr
;
131
QgsAggregateToolButton
*mAggregateButton =
nullptr
;
132
QVariant mPreviousValue;
133
bool
mBlockValueUpdate;
134
bool
mIsMixed;
135
bool
mIsChanged;
136
137
void
updateWidgets()
override
;
138
};
139
140
#endif // QGSATTRIBUTEFORMEDITORWIDGET_H
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition:
qgis_sip.h:46
QgsAttributeFormWidget
Base class for all widgets shown on a QgsAttributeForm.
Definition:
qgsattributeformwidget.h:38
QgsAttributeEditorContext
This class contains context information for attribute editor widgets.
Definition:
qgsattributeeditorcontext.h:38
QgsEditorWidgetWrapper
Manages an editor widget Widget and wrapper share the same parent.
Definition:
qgseditorwidgetwrapper.h:42
QgsSearchWidgetToolButton
A tool button widget which is displayed next to search widgets in forms, and allows for controlling h...
Definition:
qgssearchwidgettoolbutton.h:38
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:32
QgsAggregateToolButton
Offers a toolbutton to choose between different aggregate functions.
Definition:
qgsaggregatetoolbutton.h:33
QgsAttributeFormEditorWidget
A widget consisting of both an editor widget and additional widgets for controlling the behavior of t...
Definition:
qgsattributeformeditorwidget.h:42
QgsAttributeFormEditorWidget::hasChanged
bool hasChanged() const
Returns true if the widget's value has been changed since it was initialized.
Definition:
qgsattributeformeditorwidget.h:73
qgis_sip.h
QgsAttributeForm
Definition:
qgsattributeform.h:44
QgsEditorWidgetWrapper::ConstraintResult
ConstraintResult
Result of constraint checks.
Definition:
qgseditorwidgetwrapper.h:55
qgsattributeformwidget.h
QgsAttributeFormWidget::createSearchWidgetWrappers
virtual void createSearchWidgetWrappers(const QgsAttributeEditorContext &context=QgsAttributeEditorContext())=0
Creates the search widget wrappers for the widget used when the form is in search mode...
qgseditorwidgetwrapper.h
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition:
qgsvectorlayer.h:362
Generated on Sun Jan 19 2020 15:27:13 for QGIS API Documentation by
1.8.11