QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
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
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:61
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:75
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.