QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgssinglesymbolrendererwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssinglesymbolrendererwidget.h
3  ---------------------
4  begin : November 2009
5  copyright : (C) 2009 by Martin Dobias
6  email : wonder dot sk at gmail dot 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 #ifndef QGSSINGLESYMBOLRENDERERWIDGET_H
16 #define QGSSINGLESYMBOLRENDERERWIDGET_H
17 
18 #include "qgsrendererwidget.h"
19 #include "qgis_sip.h"
20 #include "qgis_gui.h"
21 
24 
25 class QMenu;
26 
32 {
33  Q_OBJECT
34 
35  public:
36  static QgsRendererWidget *create( QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *renderer ) SIP_FACTORY;
37 
40 
41  QgsFeatureRenderer *renderer() override;
42 
43  void setContext( const QgsSymbolWidgetContext &context ) override;
44  void setDockMode( bool dockMode ) override;
45  void disableSymbolLevels() override SIP_SKIP;
46 
47  protected:
48  void setSymbolLevels( const QList< QgsLegendSymbolItem > &levels, bool enabled ) override;
49 
50  private slots:
51  void changeSingleSymbol();
52 
53  void showSymbolLevels();
54 
55  void dataDefinedSizeLegend();
56 
57  private:
58 
59  std::unique_ptr< QgsSingleSymbolRenderer > mRenderer;
60  QgsSymbolSelectorWidget *mSelector = nullptr;
61  std::unique_ptr< QgsSymbol > mSingleSymbol;
62  QAction *mActionLevels = nullptr;
63 };
64 
65 
66 #endif // QGSSINGLESYMBOLRENDERERWIDGET_H
QgsRendererWidget::renderer
virtual QgsFeatureRenderer * renderer()=0
Returns pointer to the renderer (no transfer of ownership)
QgsSingleSymbolRendererWidget
Definition: qgssinglesymbolrendererwidget.h:31
QgsSymbolWidgetContext
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
Definition: qgssymbolwidgetcontext.h:35
QgsSingleSymbolRenderer
Definition: qgssinglesymbolrenderer.h:29
QgsSymbolSelectorWidget
Symbol selector widget that can be used to select and build a symbol.
Definition: qgssymbolselectordialog.h:87
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsRendererWidget::disableSymbolLevels
virtual void disableSymbolLevels()
Disables symbol level modification on the widget.
Definition: qgsrendererwidget.cpp:369
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
qgis_sip.h
QgsRendererWidget::setDockMode
void setDockMode(bool dockMode) override
Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs.
Definition: qgsrendererwidget.cpp:356
QgsRendererWidget::setSymbolLevels
virtual void setSymbolLevels(const QList< QgsLegendSymbolItem > &levels, bool enabled)
Sets the symbol levels for the renderer defined in the widget.
Definition: qgsrendererwidget.cpp:387
QgsRendererWidget
Base class for renderer settings widgets.
Definition: qgsrendererwidget.h:45
QgsFeatureRenderer
Definition: qgsrenderer.h:101
QgsStyle
Definition: qgsstyle.h:159
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:391
qgsrendererwidget.h
QgsRendererWidget::setContext
virtual void setContext(const QgsSymbolWidgetContext &context)
Sets the context in which the renderer widget is shown, e.g., the associated map canvas and expressio...
Definition: qgsrendererwidget.cpp:341