QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgssymbolslistwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssymbolslistwidget.h
3  ---------------------
4  begin : June 2012
5  copyright : (C) 2012 by Arunmozhi
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 QGSSYMBOLSLISTWIDGET_H
17 #define QGSSYMBOLSLISTWIDGET_H
18 
19 #include "ui_widget_symbolslist.h"
20 
21 #include <QWidget>
22 
23 class QgsSymbolV2;
24 class QgsStyleV2;
25 
26 class QMenu;
27 
31 class GUI_EXPORT QgsSymbolsListWidget : public QWidget, private Ui::SymbolsListWidget
32 {
33  Q_OBJECT
34 
35  public:
36  QgsSymbolsListWidget( QgsSymbolV2* symbol, QgsStyleV2* style, QMenu* menu, QWidget* parent, const QgsVectorLayer * layer = nullptr );
37 
39  virtual ~QgsSymbolsListWidget();
40 
47  QgsExpressionContext* expressionContext() const { return mPresetExpressionContext; }
48 
55  virtual void setMapCanvas( QgsMapCanvas* canvas );
56 
61  const QgsMapCanvas* mapCanvas() const;
62 
66  const QgsVectorLayer* layer() const { return mLayer; }
67 
68  public slots:
69 
78  void setExpressionContext( QgsExpressionContext* context );
79 
80  void setSymbolFromStyle( const QModelIndex & index );
81  void setSymbolColor( const QColor& color );
82  void setMarkerAngle( double angle );
83  void setMarkerSize( double size );
84  void setLineWidth( double width );
85  void addSymbolToStyle();
86  void saveSymbol();
87  void symbolAddedToStyle( const QString& name, QgsSymbolV2* symbol );
88  void on_mSymbolUnitWidget_changed();
89  void on_mTransparencySlider_valueChanged( int value );
90 
91  void on_groupsCombo_currentIndexChanged( int index );
92  void on_groupsCombo_editTextChanged( const QString &text );
93 
94  void openStyleManager();
95  void clipFeaturesToggled( bool checked );
96 
97  void updateDataDefinedMarkerSize();
98  void updateDataDefinedMarkerAngle();
99  void updateDataDefinedLineWidth();
100 
101  signals:
102  void changed();
103 
104  protected:
111 
112  void populateSymbolView();
113  void populateSymbols( const QStringList& symbols );
114  void updateSymbolColor();
115  void updateSymbolInfo();
116 
117  private:
119  void displayTransparency( double alpha );
121  void populateGroups( const QString& parent = "", const QString& prepend = "" );
122 
123  QgsExpressionContext* mPresetExpressionContext;
124 };
125 
126 #endif //QGSSYMBOLSLISTWIDGET_H
127 
128 
129 
static unsigned index
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:109
const QgsVectorLayer * mLayer
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
const QgsVectorLayer * layer() const
Returns the vector layer associated with the widget.
double ANALYSIS_EXPORT angle(Point3D *p1, Point3D *p2, Point3D *p3, Point3D *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
QgsExpressionContext * expressionContext() const
Returns the expression context used for the widget, if set.
Represents a vector layer which manages a vector based data sets.