QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
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
25
26class QgsVectorLayer;
28
38class 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
87 void changed();
88
89 protected:
90
96 void initializeDataDefinedButton( QgsPropertyOverrideButton *button, QgsWidgetWrapper::Property key );
97
101 void updateDataDefinedButtons();
102
106 void updateDataDefinedButton( QgsPropertyOverrideButton *button );
107
110
111 private slots:
112
113 void updateProperty();
114
115 private:
116 QgsVectorLayer *mLayer = nullptr;
117 int mField;
118};
119
120#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