QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgslayerpropertieswidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgslayerpropertieswidget.h
3  ---------------------
4  begin : June 2012
5  copyright : (C) 2012 by Martin Dobias
6  email : aruntheguy at gmail.com
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 QGSLAYERPROPERTIESWIDGET_H
17 #define QGSLAYERPROPERTIESWIDGET_H
18 
19 #include "ui_widget_layerproperties.h"
20 #include "qgsexpressioncontext.h"
21 #include "qgssymbolwidgetcontext.h"
22 #include "qgssymbollayer.h"
23 
24 class QgsSymbol;
25 class QgsSymbolLayer;
27 class QgsVectorLayer;
28 class QgsMapCanvas;
29 class QgsPanelWidget;
30 
31 class SymbolLayerItem;
32 
33 #include <QMap>
34 #include <QStandardItemModel>
35 #include "qgis_gui.h"
36 
41 class GUI_EXPORT QgsLayerPropertiesWidget : public QgsPanelWidget, public QgsExpressionContextGenerator, private Ui::LayerPropertiesWidget
42 {
43  Q_OBJECT
44 
45  public:
46 
54  QgsLayerPropertiesWidget( QgsSymbolLayer *layer, const QgsSymbol *symbol, QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
55 
62  void setContext( const QgsSymbolWidgetContext &context );
63 
69  QgsSymbolWidgetContext context() const;
70 
76  void setDockMode( bool dockMode ) override;
77 
78  public slots:
79  void layerTypeChanged();
80  void emitSignalChanged();
81 
82  signals:
83  void changed();
84  void changeLayer( QgsSymbolLayer * );
85 
86  protected:
87  void populateLayerTypes();
88  void updateSymbolLayerWidget( QgsSymbolLayer *layer );
89 
91 
98  void registerDataDefinedButton( QgsPropertyOverrideButton *button, QgsSymbolLayer::Property key );
99 
100  protected: // data
101  QgsSymbolLayer *mLayer = nullptr;
102 
103  const QgsSymbol *mSymbol = nullptr;
104  QgsVectorLayer *mVectorLayer = nullptr;
105 
106  private slots:
107  void reloadLayer();
108  void mEnabledCheckBox_toggled( bool enabled );
109  void updateProperty();
110 
111  private:
112 
113  QgsSymbolWidgetContext mContext;
114 
115 };
116 
117 #endif //QGSLAYERPROPERTIESWIDGET_H
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:369
QgsPanelWidget::setDockMode
virtual void setDockMode(bool dockMode)
Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs.
Definition: qgspanelwidget.cpp:44
QgsSymbolLayerWidget
Definition: qgssymbollayerwidget.h:34
QgsSymbolWidgetContext
Definition: qgssymbolwidgetcontext.h:35
QgsMapCanvas
Definition: qgsmapcanvas.h:83
QgsSymbol
Definition: qgssymbol.h:63
qgssymbolwidgetcontext.h
QgsPropertyOverrideButton
Definition: qgspropertyoverridebutton.h:50
qgsexpressioncontext.h
QgsSymbolLayer
Definition: qgssymbollayer.h:52
QgsPanelWidget
Base class for any widget that can be shown as a inline panel.
Definition: qgspanelwidget.h:29
QgsLayerPropertiesWidget
Definition: qgslayerpropertieswidget.h:41
QgsExpressionContextGenerator::createExpressionContext
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
qgssymbollayer.h
QgsVectorLayer
Definition: qgsvectorlayer.h:385
QgsSymbolLayer::Property
Property
Data definable properties.
Definition: qgssymbollayer.h:130
QgsExpressionContextGenerator
Definition: qgsexpressioncontextgenerator.h:36
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53