QGIS API Documentation 3.41.0-Master (25ec5511245)
Loading...
Searching...
No Matches
Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsEditorConfigWidget Class Referenceabstract

This class should be subclassed for every configurable editor widget type. More...

#include <qgseditorconfigwidget.h>

Inheritance diagram for QgsEditorConfigWidget:
Inheritance graph
[legend]

Signals

void changed ()
 Emitted when the configuration of the widget is changed.
 

Public Member Functions

 QgsEditorConfigWidget (QgsVectorLayer *vl, int fieldIdx, QWidget *parent)
 Create a new configuration widget.
 
virtual QVariantMap config ()=0
 Create a configuration from the current GUI state.
 
QgsExpressionContext createExpressionContext () const override
 This method needs to be reimplemented in all classes which implement this interface and return an expression context.
 
int field ()
 Returns the field for which this configuration widget applies.
 
QgsVectorLayerlayer ()
 Returns the layer for which this configuration widget applies.
 
virtual void setConfig (const QVariantMap &config)=0
 Update the configuration widget to represent the given configuration.
 
- Public Member Functions inherited from QgsExpressionContextGenerator
virtual ~QgsExpressionContextGenerator ()=default
 

Protected Member Functions

void initializeDataDefinedButton (QgsPropertyOverrideButton *button, QgsWidgetWrapper::Property key)
 Registers a property override button, setting up its initial value, connections and description.
 
void updateDataDefinedButton (QgsPropertyOverrideButton *button)
 Updates a specific property override button to reflect the widgets's current properties.
 
void updateDataDefinedButtons ()
 Updates all property override buttons to reflect the widgets's current properties.
 

Protected Attributes

QgsPropertyCollection mPropertyCollection
 Temporary property collection for config widgets.
 

Detailed Description

This class should be subclassed for every configurable editor widget type.

It implements the GUI configuration widget and transforms this to/from a configuration.

It will only be instantiated by {

See also
QgsEditorWidgetFactory}

Definition at line 38 of file qgseditorconfigwidget.h.

Constructor & Destructor Documentation

◆ QgsEditorConfigWidget()

QgsEditorConfigWidget::QgsEditorConfigWidget ( QgsVectorLayer vl,
int  fieldIdx,
QWidget *  parent 
)
explicit

Create a new configuration widget.

Parameters
vlThe layer for which the configuration dialog will be created
fieldIdxThe index of the field on the layer for which this dialog will be created
parentA parent widget

Definition at line 21 of file qgseditorconfigwidget.cpp.

Member Function Documentation

◆ changed

void QgsEditorConfigWidget::changed ( )
signal

Emitted when the configuration of the widget is changed.

◆ config()

virtual QVariantMap QgsEditorConfigWidget::config ( )
pure virtual

◆ createExpressionContext()

QgsExpressionContext QgsEditorConfigWidget::createExpressionContext ( ) const
overridevirtual

This method needs to be reimplemented in all classes which implement this interface and return an expression context.

Implements QgsExpressionContextGenerator.

Reimplemented in QgsExternalResourceConfigDlg.

Definition at line 39 of file qgseditorconfigwidget.cpp.

◆ field()

int QgsEditorConfigWidget::field ( )

Returns the field for which this configuration widget applies.

Returns
The field index

Definition at line 29 of file qgseditorconfigwidget.cpp.

◆ initializeDataDefinedButton()

void QgsEditorConfigWidget::initializeDataDefinedButton ( QgsPropertyOverrideButton button,
QgsWidgetWrapper::Property  key 
)
protected

Registers a property override button, setting up its initial value, connections and description.

Parameters
buttonbutton to register
keycorresponding data defined property key

Definition at line 44 of file qgseditorconfigwidget.cpp.

◆ layer()

QgsVectorLayer * QgsEditorConfigWidget::layer ( )

Returns the layer for which this configuration widget applies.

Returns
The layer

Definition at line 34 of file qgseditorconfigwidget.cpp.

◆ setConfig()

virtual void QgsEditorConfigWidget::setConfig ( const QVariantMap &  config)
pure virtual

Update the configuration widget to represent the given configuration.

Parameters
configThe configuration which should be represented by this widget

Implemented in QgsCheckBoxConfigDlg, QgsDateTimeEditConfig, QgsDummyConfigDlg, QgsExternalResourceConfigDlg, QgsJsonEditConfigDlg, QgsListConfigDlg, QgsRangeConfigDlg, QgsRelationReferenceConfigDlg, QgsTextEditConfigDlg, QgsUniqueValuesConfigDlg, QgsValueMapConfigDlg, and QgsValueRelationConfigDlg.

◆ updateDataDefinedButton()

void QgsEditorConfigWidget::updateDataDefinedButton ( QgsPropertyOverrideButton button)
protected

Updates a specific property override button to reflect the widgets's current properties.

Definition at line 62 of file qgseditorconfigwidget.cpp.

◆ updateDataDefinedButtons()

void QgsEditorConfigWidget::updateDataDefinedButtons ( )
protected

Updates all property override buttons to reflect the widgets's current properties.

Definition at line 53 of file qgseditorconfigwidget.cpp.

Member Data Documentation

◆ mPropertyCollection

QgsPropertyCollection QgsEditorConfigWidget::mPropertyCollection
protected

Temporary property collection for config widgets.

Definition at line 109 of file qgseditorconfigwidget.h.


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