QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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 #include <QMap>
32 #include <QStandardItemModel>
33 #include "qgis_gui.h"
34 
39 class GUI_EXPORT QgsLayerPropertiesWidget : public QgsPanelWidget, public QgsExpressionContextGenerator, private Ui::LayerPropertiesWidget
40 {
41  Q_OBJECT
42 
43  public:
44 
52  QgsLayerPropertiesWidget( QgsSymbolLayer *layer, const QgsSymbol *symbol, QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
53 
60  void setContext( const QgsSymbolWidgetContext &context );
61 
67  QgsSymbolWidgetContext context() const;
68 
74  void setDockMode( bool dockMode ) override;
75 
76  public slots:
77  void layerTypeChanged();
78  void emitSignalChanged();
79 
80  signals:
81  void changed();
82  void changeLayer( QgsSymbolLayer * );
83 
84  protected:
85  void populateLayerTypes();
86  void updateSymbolLayerWidget( QgsSymbolLayer *layer );
87 
89 
96  void registerDataDefinedButton( QgsPropertyOverrideButton *button, QgsSymbolLayer::Property key );
97 
98  protected: // data
99  QgsSymbolLayer *mLayer = nullptr;
100 
101  const QgsSymbol *mSymbol = nullptr;
102  QgsVectorLayer *mVectorLayer = nullptr;
103 
104  private slots:
105  void reloadLayer();
106  void mEnabledCheckBox_toggled( bool enabled );
107  void updateProperty();
108 
109  private:
110 
111  QgsSymbolWidgetContext mContext;
112 
113 };
114 
115 #endif //QGSLAYERPROPERTIESWIDGET_H
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:406
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:37
QgsSymbolWidgetContext
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
Definition: qgssymbolwidgetcontext.h:35
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:89
QgsSymbol
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:92
qgssymbolwidgetcontext.h
QgsPropertyOverrideButton
A button for controlling property overrides which may apply to a widget.
Definition: qgspropertyoverridebutton.h:50
qgsexpressioncontext.h
QgsSymbolLayer
Definition: qgssymbollayer.h:54
QgsPanelWidget
Base class for any widget that can be shown as a inline panel.
Definition: qgspanelwidget.h:29
QgsLayerPropertiesWidget
Definition: qgslayerpropertieswidget.h:39
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
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:391
QgsSymbolLayer::Property
Property
Data definable properties.
Definition: qgssymbollayer.h:142
QgsExpressionContextGenerator
Abstract interface for generating an expression context.
Definition: qgsexpressioncontextgenerator.h:36
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53