QGIS API Documentation  2.99.0-Master (37c43df)
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 
23 class QgsSymbol;
24 class QgsSymbolLayer;
26 class QgsVectorLayer;
27 class QgsMapCanvas;
28 class QgsPanelWidget;
29 
30 class SymbolLayerItem;
31 
32 #include <QMap>
33 #include <QStandardItemModel>
34 
38 class GUI_EXPORT QgsLayerPropertiesWidget : public QgsPanelWidget, protected QgsExpressionContextGenerator, private Ui::LayerPropertiesWidget
39 {
40  Q_OBJECT
41 
42  public:
43  QgsLayerPropertiesWidget( QgsSymbolLayer* layer, const QgsSymbol* symbol, const QgsVectorLayer* vl, QWidget* parent = nullptr );
44 
50  void setContext( const QgsSymbolWidgetContext& context );
51 
56  QgsSymbolWidgetContext context() const;
57 
63  virtual void setDockMode( bool dockMode ) override;
64 
65  public slots:
66  void layerTypeChanged();
67  void emitSignalChanged();
68 
69  signals:
70  void changed();
71  void changeLayer( QgsSymbolLayer* );
72 
73  protected:
74  void populateLayerTypes();
75  void updateSymbolLayerWidget( QgsSymbolLayer* layer );
76 
78 
79  protected: // data
81 
84 
85  private slots:
86  void reloadLayer();
87  void on_mEnabledCheckBox_toggled( bool enabled );
88 
89  void updateDataDefinedEnable();
90 
91  private:
92 
93  QgsSymbolWidgetContext mContext;
94 
95 };
96 
97 #endif //QGSLAYERPROPERTIESWIDGET_H
Base class for any widget that can be shown as a inline panel.
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:106
virtual void setDockMode(bool dockMode)
Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs...
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Contains settings which reflect the context in which a symbol (or renderer) widget is shown...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Abstract interface for generating an expression context.
Represents a vector layer which manages a vector based data sets.
const QgsVectorLayer * mVectorLayer