QGIS API Documentation 3.41.0-Master (cea29feecf2)
|
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. | |
~QgsAttributeFormWidget () override | |
void | addAdditionalSearchWidgetWrapper (QgsSearchWidgetWrapper *wrapper) |
Adds an additional search widget wrapper. | |
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 the widget. | |
QgsAttributeForm * | form () const |
The form on which this widget is shown. | |
QgsVectorLayer * | layer () |
The layer for which this widget and its form is shown. | |
Mode | mode () const |
Returns the current mode for the widget. | |
void | resetSearch () |
Resets the search/filter value of the widget. | |
QWidget * | searchWidgetFrame () |
Returns the widget which should be used as a parent during construction of the search widget wrapper. | |
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. | |
QList< QgsSearchWidgetWrapper * > | searchWidgetWrappers () |
Returns the search widget wrapper used in this widget. | |
void | setMode (Mode mode) |
Sets the current mode for the widget. | |
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. | |
void | setSearchWidgetWrapper (QgsSearchWidgetWrapper *wrapper) |
Sets the search widget wrapper for the widget used when the form is in search mode. | |
Protected Member Functions | |
QWidget * | editPage () const |
Returns a pointer to the EDIT page widget. | |
QWidget * | searchPage () const |
Returns a pointer to the search page widget. | |
void | setVisiblePageForMode (QgsAttributeFormWidget::Mode mode) |
Sets the visible page in the widget to the page matching the specified mode. | |
QStackedWidget * | stack () const |
Returns a pointer to the stacked widget managing edit and search page. | |
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 37 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 43 of file qgsattributeformwidget.h.
|
explicit |
A new form widget for the wrapper widget on form.
Definition at line 23 of file qgsattributeformwidget.cpp.
|
override |
Definition at line 76 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 114 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 127 of file qgsattributeformwidget.cpp.
|
protected |
Returns a pointer to the EDIT page widget.
Definition at line 244 of file qgsattributeformwidget.cpp.
QgsAttributeForm * QgsAttributeFormWidget::form | ( | ) | const |
The form on which this widget is shown.
Definition at line 92 of file qgsattributeformwidget.cpp.
QgsVectorLayer * QgsAttributeFormWidget::layer | ( | ) |
The layer for which this widget and its form is shown.
Definition at line 163 of file qgsattributeformwidget.cpp.
|
inline |
Returns the current mode for the widget.
Definition at line 85 of file qgsattributeformwidget.h.
void QgsAttributeFormWidget::resetSearch | ( | ) |
Resets the search/filter value of the widget.
Definition at line 153 of file qgsattributeformwidget.cpp.
|
protected |
Returns a pointer to the search page widget.
Definition at line 234 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 97 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 224 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 122 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 86 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 229 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 102 of file qgsattributeformwidget.cpp.
|
protected |
Sets the visible page in the widget to the page matching the specified mode.
Definition at line 191 of file qgsattributeformwidget.cpp.
|
protected |
Returns a pointer to the stacked widget managing edit and search page.
Definition at line 239 of file qgsattributeformwidget.cpp.