QGIS API Documentation  2.14.0-Essen
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 
28 class GUI_EXPORT QgsSymbolsListWidget : public QWidget, private Ui::SymbolsListWidget
29 {
30  Q_OBJECT
31 
32  public:
33  QgsSymbolsListWidget( QgsSymbolV2* symbol, QgsStyleV2* style, QMenu* menu, QWidget* parent, const QgsVectorLayer * layer = nullptr );
34 
36  virtual ~QgsSymbolsListWidget();
37 
44  QgsExpressionContext* expressionContext() const { return mPresetExpressionContext; }
45 
52  virtual void setMapCanvas( QgsMapCanvas* canvas );
53 
58  const QgsMapCanvas* mapCanvas() const;
59 
63  const QgsVectorLayer* layer() const { return mLayer; }
64 
65  public slots:
66 
75  void setExpressionContext( QgsExpressionContext* context );
76 
77  void setSymbolFromStyle( const QModelIndex & index );
78  void setSymbolColor( const QColor& color );
79  void setMarkerAngle( double angle );
80  void setMarkerSize( double size );
81  void setLineWidth( double width );
82  void addSymbolToStyle();
83  void saveSymbol();
84  void symbolAddedToStyle( const QString& name, QgsSymbolV2* symbol );
85  void on_mSymbolUnitWidget_changed();
86  void on_mTransparencySlider_valueChanged( int value );
87 
88  void on_groupsCombo_currentIndexChanged( int index );
89  void on_groupsCombo_editTextChanged( const QString &text );
90 
91  void openStyleManager();
92  void clipFeaturesToggled( bool checked );
93 
94  void updateDataDefinedMarkerSize();
95  void updateDataDefinedMarkerAngle();
96  void updateDataDefinedLineWidth();
97 
98  signals:
99  void changed();
100 
101  protected:
108 
109  void populateSymbolView();
110  void populateSymbols( const QStringList& symbols );
111  void updateSymbolColor();
112  void updateSymbolInfo();
113 
114  private:
116  void displayTransparency( double alpha );
118  void populateGroups( const QString& parent = "", const QString& prepend = "" );
119 
120  QgsExpressionContext* mPresetExpressionContext;
121 };
122 
123 #endif //QGSSYMBOLSLISTWIDGET_H
124 
125 
126 
static unsigned index
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:105
const QgsVectorLayer * mLayer
const QgsVectorLayer * layer() const
Returns the vector layer associated with the widget.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QgsExpressionContext * expressionContext() const
Returns the expression context used for the widget, if set.
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)
Represents a vector layer which manages a vector based data sets.