QGIS API Documentation  2.99.0-Master (bdf46d7)
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 
40 class GUI_EXPORT QgsLayerPropertiesWidget : public QgsPanelWidget, public QgsExpressionContextGenerator, private Ui::LayerPropertiesWidget
41 {
42  Q_OBJECT
43 
44  public:
45  QgsLayerPropertiesWidget( QgsSymbolLayer *layer, const QgsSymbol *symbol, const QgsVectorLayer *vl, QWidget *parent = nullptr );
46 
52  void setContext( const QgsSymbolWidgetContext &context );
53 
58  QgsSymbolWidgetContext context() const;
59 
65  virtual void setDockMode( bool dockMode ) override;
66 
67  public slots:
68  void layerTypeChanged();
69  void emitSignalChanged();
70 
71  signals:
72  void changed();
73  void changeLayer( QgsSymbolLayer * );
74 
75  protected:
76  void populateLayerTypes();
77  void updateSymbolLayerWidget( QgsSymbolLayer *layer );
78 
80 
87  void registerDataDefinedButton( QgsPropertyOverrideButton *button, QgsSymbolLayer::Property key );
88 
89  protected: // data
90  QgsSymbolLayer *mLayer = nullptr;
91 
92  const QgsSymbol *mSymbol = nullptr;
93  const QgsVectorLayer *mVectorLayer = nullptr;
94 
95  private slots:
96  void reloadLayer();
97  void on_mEnabledCheckBox_toggled( bool enabled );
98  void updateProperty();
99 
100  private:
101 
102  QgsSymbolWidgetContext mContext;
103 
104 };
105 
106 #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:72
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...
A button for controlling property overrides which may apply to a widget.
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.
Property
Data definable properties.