QGIS API Documentation  3.23.0-Master (eb871beae0)
qgseditorconfigwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgseditorconfigwidget.h
3  --------------------------------------
4  Date : 24.4.2013
5  Copyright : (C) 2013 Matthias Kuhn
6  Email : matthias at opengis dot ch
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSEDITORCONFIGWIDGET_H
17 #define QGSEDITORCONFIGWIDGET_H
18 
19 #include <QWidget>
20 #include "qgis_sip.h"
21 #include "qgis_gui.h"
22 
23 #include "qgseditorwidgetwrapper.h"
25 
26 class QgsVectorLayer;
28 
38 class GUI_EXPORT QgsEditorConfigWidget : public QWidget, public QgsExpressionContextGenerator
39 {
40  Q_OBJECT
41  public:
42 
50  explicit QgsEditorConfigWidget( QgsVectorLayer *vl, int fieldIdx, QWidget *parent SIP_TRANSFERTHIS );
51 
57  virtual QVariantMap config() = 0;
58 
64  virtual void setConfig( const QVariantMap &config ) = 0;
65 
71  int field();
72 
78  QgsVectorLayer *layer();
79 
81 
82  signals:
83 
88  void changed();
89 
90  protected:
91 
97  void initializeDataDefinedButton( QgsPropertyOverrideButton *button, QgsWidgetWrapper::Property key );
98 
102  void updateDataDefinedButtons();
103 
107  void updateDataDefinedButton( QgsPropertyOverrideButton *button );
108 
111 
112  private slots:
113 
114  void updateProperty();
115 
116  private:
117  QgsVectorLayer *mLayer = nullptr;
118  int mField;
119 };
120 
121 #endif // QGSEDITORCONFIGWIDGET_H
This class should be subclassed for every configurable editor widget type.
virtual QVariantMap config()=0
Create a configuration from the current GUI state.
QgsPropertyCollection mPropertyCollection
Temporary property collection for config widgets.
virtual void setConfig(const QVariantMap &config)=0
Update the configuration widget to represent the given configuration.
void changed()
Emitted when the configuration of the widget is changed.
Abstract interface for generating an expression context.
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
A button for controlling property overrides which may apply to a widget.
Represents a vector layer which manages a vector based data sets.
Property
Data defined properties for different editor widgets.
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
const QgsField & field
Definition: qgsfield.h:463