QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
Public Member Functions | Static Public Member Functions | List of all members
QgsValueMapConfigDlg Class Reference

#include <qgsvaluemapconfigdlg.h>

Inheritance diagram for QgsValueMapConfigDlg:
Inheritance graph
[legend]

Public Member Functions

 QgsValueMapConfigDlg (QgsVectorLayer *vl, int fieldIdx, QWidget *parent)
 
QVariantMap config () override
 Create a configuration from the current GUI state. More...
 
bool eventFilter (QObject *watched, QEvent *event) override
 
void loadMapFromCSV (const QString &filePath)
 Updates the displayed table with the values from a CSV file. More...
 
void setConfig (const QVariantMap &config) override
 Update the configuration widget to represent the given configuration. More...
 
void updateMap (const QList< QPair< QString, QVariant > > &list, bool insertNull)
 Updates the displayed table with the values from list, the order of the values is preserved. More...
 
void updateMap (const QMap< QString, QVariant > &map, bool insertNull)
 Updates the displayed table with the values from map. More...
 
- Public Member Functions inherited from QgsEditorConfigWidget
 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
 
virtual QgsExpressionContext createExpressionContext () const =0
 This method needs to be reimplemented in all classes which implement this interface and return an expression context. More...
 

Static Public Member Functions

static void populateComboBox (QComboBox *comboBox, const QVariantMap &configuration, bool skipNull)
 Populates a comboBox with the appropriate entries based on a value map configuration. More...
 

Additional Inherited Members

- Signals inherited from QgsEditorConfigWidget
void changed ()
 Emitted when the configuration of the widget is changed. More...
 
- Protected Member Functions inherited from QgsEditorConfigWidget
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 inherited from QgsEditorConfigWidget
QgsPropertyCollection mPropertyCollection
 Temporary property collection for config widgets. More...
 

Detailed Description

Note
not available in Python bindings

Definition at line 34 of file qgsvaluemapconfigdlg.h.

Constructor & Destructor Documentation

◆ QgsValueMapConfigDlg()

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

Definition at line 31 of file qgsvaluemapconfigdlg.cpp.

Member Function Documentation

◆ config()

QVariantMap QgsValueMapConfigDlg::config ( )
overridevirtual

Create a configuration from the current GUI state.

Returns
A widget configuration

Implements QgsEditorConfigWidget.

Definition at line 49 of file qgsvaluemapconfigdlg.cpp.

◆ eventFilter()

bool QgsValueMapConfigDlg::eventFilter ( QObject *  watched,
QEvent *  event 
)
override

Definition at line 217 of file qgsvaluemapconfigdlg.cpp.

◆ loadMapFromCSV()

void QgsValueMapConfigDlg::loadMapFromCSV ( const QString &  filePath)

Updates the displayed table with the values from a CSV file.

Parameters
filePaththe absolute file path of the CSV file.
Since
QGIS 3.24

Definition at line 307 of file qgsvaluemapconfigdlg.cpp.

◆ populateComboBox()

void QgsValueMapConfigDlg::populateComboBox ( QComboBox *  comboBox,
const QVariantMap &  configuration,
bool  skipNull 
)
static

Populates a comboBox with the appropriate entries based on a value map configuration.

If skipNull is true, then NULL entries will not be added.

Since
QGIS 3.0

Definition at line 188 of file qgsvaluemapconfigdlg.cpp.

◆ setConfig()

void QgsValueMapConfigDlg::setConfig ( const QVariantMap &  config)
overridevirtual

Update the configuration widget to represent the given configuration.

Parameters
configThe configuration which should be represented by this widget

Implements QgsEditorConfigWidget.

Definition at line 84 of file qgsvaluemapconfigdlg.cpp.

◆ updateMap() [1/2]

void QgsValueMapConfigDlg::updateMap ( const QList< QPair< QString, QVariant > > &  list,
bool  insertNull 
)

Updates the displayed table with the values from list, the order of the values is preserved.

If insertNull is set to true, it will also insert a NULL value.

Since
QGIS 3.12

Definition at line 163 of file qgsvaluemapconfigdlg.cpp.

◆ updateMap() [2/2]

void QgsValueMapConfigDlg::updateMap ( const QMap< QString, QVariant > &  map,
bool  insertNull 
)

Updates the displayed table with the values from map.

If insertNull is set to true, it will also insert a NULL value.

Note
In most cases the overload that accepts a list is preferred as it keeps the order of the values.

Definition at line 151 of file qgsvaluemapconfigdlg.cpp.


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