QGIS API Documentation 3.41.0-Master (af5edcb665c)
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:
49 explicit QgsEditorConfigWidget( QgsVectorLayer *vl, int fieldIdx, QWidget *parent SIP_TRANSFERTHIS );
50
56 virtual QVariantMap config() = 0;
57
63 virtual void setConfig( const QVariantMap &config ) = 0;
64
70 int field();
71
77 QgsVectorLayer *layer();
78
80
81 signals:
82
86 void changed();
87
88 protected:
94 void initializeDataDefinedButton( QgsPropertyOverrideButton *button, QgsWidgetWrapper::Property key );
95
99 void updateDataDefinedButtons();
100
104 void updateDataDefinedButton( QgsPropertyOverrideButton *button );
105
108
109 private slots:
110
111 void updateProperty();
112
113 private:
114 QgsVectorLayer *mLayer = nullptr;
115 int mField;
116};
117
118#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