QGIS API Documentation
3.4.15-Madeira (e83d02e274)
|
Base class for all widgets shown on a QgsAttributeForm. More...
#include <qgsattributeformwidget.h>
Public Types | |
enum | Mode { DefaultMode, MultiEditMode, SearchMode, AggregateSearchMode } |
Widget modes. More... | |
Public Member Functions | |
QgsAttributeFormWidget (QgsWidgetWrapper *widget, QgsAttributeForm *form) | |
A new form widget for the wrapper widget on form. More... | |
void | addAdditionalSearchWidgetWrapper (QgsSearchWidgetWrapper *wrapper) |
Adds an additional search widget wrapper. More... | |
virtual void | createSearchWidgetWrappers (const QgsAttributeEditorContext &context=QgsAttributeEditorContext())=0 |
Creates the search widget wrappers for the widget used when the form is in search mode. More... | |
virtual QString | currentFilterExpression () const |
Creates an expression matching the current search filter value and search properties represented in the widget. More... | |
QgsAttributeForm * | form () const |
The form on which this widget is shown. More... | |
QgsVectorLayer * | layer () |
The layer for which this widget and its form is shown. More... | |
Mode | mode () const |
Returns the current mode for the widget. More... | |
void | resetSearch () |
Resets the search/filter value of the widget. More... | |
QWidget * | searchWidgetFrame () |
Returns the widget which should be used as a parent during construction of the search widget wrapper. More... | |
bool | searchWidgetToolButtonVisible () const |
The visibility of the search widget tool button, that allows (de)activating this search widgte or defines the comparison operator to use. More... | |
QList< QgsSearchWidgetWrapper * > | searchWidgetWrappers () |
Returns the search widget wrapper used in this widget. More... | |
void | setMode (Mode mode) |
Sets the current mode for the widget. More... | |
void | setSearchWidgetToolButtonVisible (bool searchWidgetToolButtonVisible) |
The visibility of the search widget tool button, that allows (de)activating this search widgte or defines the comparison operator to use. More... | |
void | setSearchWidgetWrapper (QgsSearchWidgetWrapper *wrapper) |
Sets the search widget wrapper for the widget used when the form is in search mode. More... | |
Protected Member Functions | |
QWidget * | editPage () const |
Returns a pointer to the EDIT page widget. More... | |
QWidget * | searchPage () const |
Returns a pointer to the search page widget. More... | |
QStackedWidget * | stack () const |
Returns a pointer to the stacked widget managing edit and search page. More... | |
Base class for all widgets shown on a QgsAttributeForm.
Consists of the widget which is visible in edit mode as well as the widget visible in search mode.
Definition at line 38 of file qgsattributeformwidget.h.
Widget modes.
Enumerator | |
---|---|
DefaultMode |
Default mode, only the editor widget is shown. |
MultiEditMode |
Multi edit mode, both the editor widget and a QgsMultiEditToolButton is shown. |
SearchMode |
Layer search/filter mode. |
AggregateSearchMode |
Embedded in a search form, show additional aggregate function toolbutton. |
Definition at line 45 of file qgsattributeformwidget.h.
|
explicit |
A new form widget for the wrapper widget on form.
Definition at line 22 of file qgsattributeformwidget.cpp.
void QgsAttributeFormWidget::addAdditionalSearchWidgetWrapper | ( | QgsSearchWidgetWrapper * | wrapper | ) |
Adds an additional search widget wrapper.
Used to register a secondary search widget as used for "between" searches.
Definition at line 98 of file qgsattributeformwidget.cpp.
|
pure virtual |
Creates the search widget wrappers for the widget used when the form is in search mode.
context | editor context (not available in Python bindings) |
Implemented in QgsAttributeFormEditorWidget, and QgsAttributeFormRelationEditorWidget.
|
virtual |
Creates an expression matching the current search filter value and search properties represented in the widget.
Reimplemented in QgsAttributeFormRelationEditorWidget.
Definition at line 111 of file qgsattributeformwidget.cpp.
|
protected |
Returns a pointer to the EDIT page widget.
Definition at line 209 of file qgsattributeformwidget.cpp.
QgsAttributeForm * QgsAttributeFormWidget::form | ( | ) | const |
The form on which this widget is shown.
Definition at line 76 of file qgsattributeformwidget.cpp.
QgsVectorLayer * QgsAttributeFormWidget::layer | ( | ) |
The layer for which this widget and its form is shown.
Definition at line 146 of file qgsattributeformwidget.cpp.
|
inline |
Returns the current mode for the widget.
Definition at line 86 of file qgsattributeformwidget.h.
void QgsAttributeFormWidget::resetSearch | ( | ) |
Resets the search/filter value of the widget.
Definition at line 137 of file qgsattributeformwidget.cpp.
|
protected |
Returns a pointer to the search page widget.
Definition at line 199 of file qgsattributeformwidget.cpp.
QWidget * QgsAttributeFormWidget::searchWidgetFrame | ( | ) |
Returns the widget which should be used as a parent during construction of the search widget wrapper.
Definition at line 81 of file qgsattributeformwidget.cpp.
bool QgsAttributeFormWidget::searchWidgetToolButtonVisible | ( | ) | const |
The visibility of the search widget tool button, that allows (de)activating this search widgte or defines the comparison operator to use.
Definition at line 189 of file qgsattributeformwidget.cpp.
QList< QgsSearchWidgetWrapper * > QgsAttributeFormWidget::searchWidgetWrappers | ( | ) |
Returns the search widget wrapper used in this widget.
The wrapper must first be created using createSearchWidgetWrapper()
Definition at line 106 of file qgsattributeformwidget.cpp.
void QgsAttributeFormWidget::setMode | ( | QgsAttributeFormWidget::Mode | mode | ) |
Sets the current mode for the widget.
The widget will adapt its state and visible widgets to reflect the updated mode. For example, showing multi edit tool buttons if the mode is set to MultiEditMode.
mode | widget mode |
Definition at line 70 of file qgsattributeformwidget.cpp.
void QgsAttributeFormWidget::setSearchWidgetToolButtonVisible | ( | bool | searchWidgetToolButtonVisible | ) |
The visibility of the search widget tool button, that allows (de)activating this search widgte or defines the comparison operator to use.
Definition at line 194 of file qgsattributeformwidget.cpp.
void QgsAttributeFormWidget::setSearchWidgetWrapper | ( | QgsSearchWidgetWrapper * | wrapper | ) |
Sets the search widget wrapper for the widget used when the form is in search mode.
wrapper | search widget wrapper. |
Definition at line 86 of file qgsattributeformwidget.cpp.
|
protected |
Returns a pointer to the stacked widget managing edit and search page.
Definition at line 204 of file qgsattributeformwidget.cpp.