QGIS API Documentation  2.13.0-Master
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 
45  QgsExpressionContext* expressionContext() const { return mPresetExpressionContext; }
46 
53  virtual void setMapCanvas( QgsMapCanvas* canvas );
54 
59  const QgsMapCanvas* mapCanvas() const;
60 
64  const QgsVectorLayer* layer() const { return mLayer; }
65 
66  public slots:
67 
76  void setExpressionContext( QgsExpressionContext* context );
77 
78  void setSymbolFromStyle( const QModelIndex & index );
79  void setSymbolColor( const QColor& color );
80  void setMarkerAngle( double angle );
81  void setMarkerSize( double size );
82  void setLineWidth( double width );
83  void addSymbolToStyle();
84  void saveSymbol();
85  void symbolAddedToStyle( const QString& name, QgsSymbolV2* symbol );
86  void on_mSymbolUnitWidget_changed();
87  void on_mTransparencySlider_valueChanged( int value );
88 
89  void on_groupsCombo_currentIndexChanged( int index );
90  void on_groupsCombo_editTextChanged( const QString &text );
91 
92  void openStyleManager();
93  void clipFeaturesToggled( bool checked );
94 
95  void updateDataDefinedMarkerSize();
96  void updateDataDefinedMarkerAngle();
97  void updateDataDefinedLineWidth();
98 
99  signals:
100  void changed();
101 
102  protected:
109 
110  void populateSymbolView();
111  void populateSymbols( const QStringList& symbols );
112  void updateSymbolColor();
113  void updateSymbolInfo();
114 
115  private:
117  void displayTransparency( double alpha );
119  void populateGroups( const QString& parent = "", const QString& prepend = "" );
120 
121  QgsExpressionContext* mPresetExpressionContext;
122 };
123 
124 #endif //QGSSYMBOLSLISTWIDGET_H
125 
126 
127 
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.