QGIS API Documentation  2.99.0-Master (5169e0d)
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. More...
 

Public Member Functions

 QgsEditorConfigWidget (QgsVectorLayer *vl, int fieldIdx, QWidget *parent)
 Create a new configuration widget. More...
 
virtual QVariantMap config ()=0
 Create a configuration from the current GUI state. More...
 
QgsExpressionContext createExpressionContext () const override
 This method needs to be reimplemented in all classes which implement this interface and return an expression context. More...
 
int field ()
 Returns the field for which this configuration widget applies. More...
 
QgsVectorLayerlayer ()
 Returns the layer for which this configuration widget applies. More...
 
virtual void setConfig (const QVariantMap &config)=0
 Update the configuration widget to represent the given configuration. More...
 
- 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. More...
 
void updateDataDefinedButton (QgsPropertyOverrideButton *button)
 Updates a specific property override button to reflect the widgets's current properties. More...
 
void updateDataDefinedButtons ()
 Updates all property override buttons to reflect the widgets's current properties. More...
 

Protected Attributes

QgsPropertyCollection mPropertyCollection
 Temporary property collection for config widgets. More...
 

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 35 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 19 of file qgseditorconfigwidget.cpp.

Member Function Documentation

◆ changed

void QgsEditorConfigWidget::changed ( )
signal

Emitted when the configuration of the widget is changed.

Since
QGIS 3.0

◆ 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.

Since
QGIS 3.0

Implements QgsExpressionContextGenerator.

Definition at line 37 of file qgseditorconfigwidget.cpp.

◆ field()

int QgsEditorConfigWidget::field ( )

Returns the field for which this configuration widget applies.

Returns
The field index

Definition at line 27 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 42 of file qgseditorconfigwidget.cpp.

◆ layer()

QgsVectorLayer * QgsEditorConfigWidget::layer ( )

Returns the layer for which this configuration widget applies.

Returns
The layer

Definition at line 32 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 QgsValueRelationConfigDlg, QgsDummyConfigDlg, QgsExternalResourceConfigDlg, QgsTextEditConfigDlg, QgsUniqueValuesConfigDlg, QgsCheckBoxConfigDlg, QgsRelationReferenceConfigDlg, QgsValueMapConfigDlg, QgsRangeConfigDlg, and QgsDateTimeEditConfig.

◆ updateDataDefinedButton()

void QgsEditorConfigWidget::updateDataDefinedButton ( QgsPropertyOverrideButton button)
protected

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

Definition at line 59 of file qgseditorconfigwidget.cpp.

◆ updateDataDefinedButtons()

void QgsEditorConfigWidget::updateDataDefinedButtons ( )
protected

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

Definition at line 51 of file qgseditorconfigwidget.cpp.

Member Data Documentation

◆ mPropertyCollection

QgsPropertyCollection QgsEditorConfigWidget::mPropertyCollection
protected

Temporary property collection for config widgets.

Definition at line 106 of file qgseditorconfigwidget.h.


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