QGIS API Documentation 3.38.0-Grenoble (exported)
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Friends | List of all members
QgsAttributeFormEditorWidget Class Reference

A widget consisting of both an editor widget and additional widgets for controlling the behavior of the editor widget depending on a number of possible modes. More...

#include <qgsattributeformeditorwidget.h>

Inheritance diagram for QgsAttributeFormEditorWidget:
Inheritance graph
[legend]

Public Slots

void changesCommitted ()
 Called when field values have been committed;.
 
void setIsMixed (bool mixed)
 Sets whether the widget should be displayed in a "mixed values" mode.
 

Signals

Q_DECL_DEPRECATED void valueChanged (const QVariant &value)
 Emitted when the widget's value changes.
 
void valuesChanged (const QVariant &value, const QVariantList &additionalFieldValues)
 Emitted when the widget's value changes.
 

Public Member Functions

 QgsAttributeFormEditorWidget (QgsEditorWidgetWrapper *editorWidget, const QString &widgetType, QgsAttributeForm *form)
 Constructor for QgsAttributeFormEditorWidget.
 
 ~QgsAttributeFormEditorWidget () override
 
void createSearchWidgetWrappers (const QgsAttributeEditorContext &context=QgsAttributeEditorContext()) override
 Creates the search widget wrappers for the widget used when the form is in search mode.
 
QVariant currentValue () const
 Returns the current value of the attached editor widget.
 
QgsEditorWidgetWrappereditorWidget () const
 Returns the editor widget wrapper.
 
bool hasChanged () const
 Returns true if the widget's value has been changed since it was initialized.
 
void initialize (const QVariant &initialValue, bool mixedValues=false, const QVariantList &additionalFieldValues=QVariantList())
 Resets the widget to an initial value.
 
void setConstraintResultVisible (bool editable)
 Set the constraint result label visible or invisible according to the layer editable status.
 
void setConstraintStatus (const QString &constraint, const QString &description, const QString &err, QgsEditorWidgetWrapper::ConstraintResult result)
 Set the constraint status for this widget.
 
- Public Member Functions inherited from QgsAttributeFormWidget
 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 QString currentFilterExpression () const
 Creates an expression matching the current search filter value and search properties represented in the widget.
 
QgsAttributeFormform () const
 The form on which this widget is shown.
 
QgsVectorLayerlayer ()
 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.
 

Friends

class TestQgsAttributeForm
 

Additional Inherited Members

- Public Types inherited from QgsAttributeFormWidget
enum  Mode { DefaultMode , MultiEditMode , SearchMode , AggregateSearchMode }
 Widget modes. More...
 
- Protected Member Functions inherited from QgsAttributeFormWidget
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.
 

Detailed Description

A widget consisting of both an editor widget and additional widgets for controlling the behavior of the editor widget depending on a number of possible modes.

For instance, if the parent attribute form is in the multi edit mode, this widget will show both the editor widget and a tool button for controlling the multi edit results.

Definition at line 41 of file qgsattributeformeditorwidget.h.

Constructor & Destructor Documentation

◆ QgsAttributeFormEditorWidget()

QgsAttributeFormEditorWidget::QgsAttributeFormEditorWidget ( QgsEditorWidgetWrapper editorWidget,
const QString &  widgetType,
QgsAttributeForm form 
)
explicit

Constructor for QgsAttributeFormEditorWidget.

Parameters
editorWidgetassociated editor widget wrapper (for default/edit modes)
widgetTypethe type identifier of the widget passed in the wrapper
formparent attribute form

Definition at line 31 of file qgsattributeformeditorwidget.cpp.

◆ ~QgsAttributeFormEditorWidget()

QgsAttributeFormEditorWidget::~QgsAttributeFormEditorWidget ( )
override

Definition at line 65 of file qgsattributeformeditorwidget.cpp.

Member Function Documentation

◆ changesCommitted

void QgsAttributeFormEditorWidget::changesCommitted ( )
slot

Called when field values have been committed;.

Definition at line 130 of file qgsattributeformeditorwidget.cpp.

◆ createSearchWidgetWrappers()

void QgsAttributeFormEditorWidget::createSearchWidgetWrappers ( const QgsAttributeEditorContext context = QgsAttributeEditorContext())
overridevirtual

Creates the search widget wrappers for the widget used when the form is in search mode.

Parameters
contexteditor context (not available in Python bindings)

Implements QgsAttributeFormWidget.

Definition at line 71 of file qgsattributeformeditorwidget.cpp.

◆ currentValue()

QVariant QgsAttributeFormEditorWidget::currentValue ( ) const

Returns the current value of the attached editor widget.

Definition at line 161 of file qgsattributeformeditorwidget.cpp.

◆ editorWidget()

QgsEditorWidgetWrapper * QgsAttributeFormEditorWidget::editorWidget ( ) const

Returns the editor widget wrapper.

Since
QGIS 3.10

Definition at line 117 of file qgsattributeformeditorwidget.cpp.

◆ hasChanged()

bool QgsAttributeFormEditorWidget::hasChanged ( ) const
inline

Returns true if the widget's value has been changed since it was initialized.

See also
initialize()

Definition at line 73 of file qgsattributeformeditorwidget.h.

◆ initialize()

void QgsAttributeFormEditorWidget::initialize ( const QVariant &  initialValue,
bool  mixedValues = false,
const QVariantList &  additionalFieldValues = QVariantList() 
)

Resets the widget to an initial value.

Parameters
initialValueinitial value to show in widget
mixedValuesset to true to initially show the mixed values state
additionalFieldValuesa variant map of additional field names with their corresponding values

Definition at line 145 of file qgsattributeformeditorwidget.cpp.

◆ setConstraintResultVisible()

void QgsAttributeFormEditorWidget::setConstraintResultVisible ( bool  editable)

Set the constraint result label visible or invisible according to the layer editable status.

Definition at line 112 of file qgsattributeformeditorwidget.cpp.

◆ setConstraintStatus()

void QgsAttributeFormEditorWidget::setConstraintStatus ( const QString &  constraint,
const QString &  description,
const QString &  err,
QgsEditorWidgetWrapper::ConstraintResult  result 
)

Set the constraint status for this widget.

Definition at line 91 of file qgsattributeformeditorwidget.cpp.

◆ setIsMixed

void QgsAttributeFormEditorWidget::setIsMixed ( bool  mixed)
slot

Sets whether the widget should be displayed in a "mixed values" mode.

Parameters
mixedset to true to show in a mixed values state

Definition at line 122 of file qgsattributeformeditorwidget.cpp.

◆ valueChanged

Q_DECL_DEPRECATED void QgsAttributeFormEditorWidget::valueChanged ( const QVariant &  value)
signal

Emitted when the widget's value changes.

Parameters
valuenew widget value
Deprecated:
since QGIS 3.10 use valuesChanged instead

◆ valuesChanged

void QgsAttributeFormEditorWidget::valuesChanged ( const QVariant &  value,
const QVariantList &  additionalFieldValues 
)
signal

Emitted when the widget's value changes.

Parameters
valuenew widget value
additionalFieldValuesof the potential additional fields
Since
QGIS 3.10

Friends And Related Symbol Documentation

◆ TestQgsAttributeForm

friend class TestQgsAttributeForm
friend

Definition at line 155 of file qgsattributeformeditorwidget.h.


The documentation for this class was generated from the following files: