-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
qgslayerpropertieswidget.h
106 lines (84 loc) · 3.37 KB
/
qgslayerpropertieswidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/***************************************************************************
qgslayerpropertieswidget.h
---------------------
begin : June 2012
copyright : (C) 2012 by Martin Dobias
email : aruntheguy at gmail.com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSLAYERPROPERTIESWIDGET_H
#define QGSLAYERPROPERTIESWIDGET_H
#include "ui_widget_layerproperties.h"
#include "qgsexpressioncontext.h"
#include "qgssymbolwidgetcontext.h"
#include "qgssymbollayer.h"
class QgsSymbol;
class QgsSymbolLayer;
class QgsSymbolLayerWidget;
class QgsVectorLayer;
class QgsMapCanvas;
class QgsPanelWidget;
class SymbolLayerItem;
#include <QMap>
#include <QStandardItemModel>
#include "qgis_gui.h"
/** \ingroup gui
* \class QgsLayerPropertiesWidget
*/
class GUI_EXPORT QgsLayerPropertiesWidget : public QgsPanelWidget, protected QgsExpressionContextGenerator, private Ui::LayerPropertiesWidget
{
Q_OBJECT
public:
QgsLayerPropertiesWidget( QgsSymbolLayer* layer, const QgsSymbol* symbol, const QgsVectorLayer* vl, QWidget* parent = nullptr );
/** Sets the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts.
* @param context symbol widget context
* @see context()
* @note added in QGIS 3.0
*/
void setContext( const QgsSymbolWidgetContext& context );
/** Returns the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts.
* @see setContext()
* @note added in QGIS 3.0
*/
QgsSymbolWidgetContext context() const;
/**
* Set the widget in dock mode which tells the widget to emit panel
* widgets and not open dialogs
* @param dockMode True to enable dock mode.
*/
virtual void setDockMode( bool dockMode ) override;
public slots:
void layerTypeChanged();
void emitSignalChanged();
signals:
void changed();
void changeLayer( QgsSymbolLayer* );
protected:
void populateLayerTypes();
void updateSymbolLayerWidget( QgsSymbolLayer* layer );
QgsExpressionContext createExpressionContext() const override;
/**
* Registers a data defined override button. Handles setting up connections
* for the button and initializing the button to show the correct descriptions
* and help text for the associated property.
* @note added in QGIS 3.0
*/
void registerDataDefinedButton( QgsPropertyOverrideButton *button, QgsSymbolLayer::Property key );
protected: // data
QgsSymbolLayer* mLayer;
const QgsSymbol* mSymbol;
const QgsVectorLayer* mVectorLayer;
private slots:
void reloadLayer();
void on_mEnabledCheckBox_toggled( bool enabled );
void updateProperty();
private:
QgsSymbolWidgetContext mContext;
};
#endif //QGSLAYERPROPERTIESWIDGET_H