QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
editorwidgets
core
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 "qgis_gui.h"
20
#include "
qgis_sip.h
"
21
#include "
qgseditorwidgetwrapper.h
"
22
#include "
qgsexpressioncontextgenerator.h
"
23
24
#include <QWidget>
25
26
class
QgsVectorLayer
;
27
class
QgsPropertyOverrideButton
;
28
39
40
class
GUI_EXPORT
QgsEditorConfigWidget
:
public
QWidget,
public
QgsExpressionContextGenerator
41
{
42
Q_OBJECT
43
public
:
51
explicit
QgsEditorConfigWidget
(
QgsVectorLayer
*vl,
int
fieldIdx, QWidget *parent
SIP_TRANSFERTHIS
);
52
58
virtual
QVariantMap
config
() = 0;
59
65
virtual
void
setConfig
(
const
QVariantMap &
config
) = 0;
66
72
int
field
();
73
79
QgsVectorLayer
*
layer
();
80
81
QgsExpressionContext
createExpressionContext
()
const override
;
82
83
signals:
84
88
void
changed
();
89
90
protected
:
96
void
initializeDataDefinedButton
(
QgsPropertyOverrideButton
*button,
QgsWidgetWrapper::Property
key );
97
101
void
updateDataDefinedButtons
();
102
106
void
updateDataDefinedButton
(
QgsPropertyOverrideButton
*button );
107
109
QgsPropertyCollection
mPropertyCollection
;
110
111
private
slots:
112
113
void
updateProperty();
114
115
private
:
116
QgsVectorLayer
*mLayer =
nullptr
;
117
int
mField;
118
};
119
120
#endif
// QGSEDITORCONFIGWIDGET_H
QgsEditorConfigWidget::QgsEditorConfigWidget
QgsEditorConfigWidget(QgsVectorLayer *vl, int fieldIdx, QWidget *parent)
Create a new configuration widget.
Definition
qgseditorconfigwidget.cpp:23
QgsEditorConfigWidget::updateDataDefinedButtons
void updateDataDefinedButtons()
Updates all property override buttons to reflect the widgets's current properties.
Definition
qgseditorconfigwidget.cpp:54
QgsEditorConfigWidget::config
virtual QVariantMap config()=0
Create a configuration from the current GUI state.
QgsEditorConfigWidget::field
int field()
Returns the field for which this configuration widget applies.
Definition
qgseditorconfigwidget.cpp:30
QgsEditorConfigWidget::mPropertyCollection
QgsPropertyCollection mPropertyCollection
Temporary property collection for config widgets.
Definition
qgseditorconfigwidget.h:109
QgsEditorConfigWidget::initializeDataDefinedButton
void initializeDataDefinedButton(QgsPropertyOverrideButton *button, QgsWidgetWrapper::Property key)
Registers a property override button, setting up its initial value, connections and description.
Definition
qgseditorconfigwidget.cpp:45
QgsEditorConfigWidget::updateDataDefinedButton
void updateDataDefinedButton(QgsPropertyOverrideButton *button)
Updates a specific property override button to reflect the widgets's current properties.
Definition
qgseditorconfigwidget.cpp:63
QgsEditorConfigWidget::layer
QgsVectorLayer * layer()
Returns the layer for which this configuration widget applies.
Definition
qgseditorconfigwidget.cpp:35
QgsEditorConfigWidget::setConfig
virtual void setConfig(const QVariantMap &config)=0
Update the configuration widget to represent the given configuration.
QgsEditorConfigWidget::changed
void changed()
Emitted when the configuration of the widget is changed.
QgsExpressionContextGenerator
Abstract interface for generating an expression context.
Definition
qgsexpressioncontextgenerator.h:36
QgsExpressionContextGenerator::createExpressionContext
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition
qgsexpressioncontext.h:491
QgsPropertyCollection
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.
Definition
qgspropertycollection.h:348
QgsPropertyOverrideButton
A button for controlling property overrides which may apply to a widget.
Definition
qgspropertyoverridebutton.h:50
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
QgsWidgetWrapper::Property
Property
Data defined properties for different editor widgets.
Definition
qgswidgetwrapper.h:78
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
qgseditorwidgetwrapper.h
qgsexpressioncontextgenerator.h
Generated on
for QGIS API Documentation by
1.17.0