QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsrendererv2widget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrendererv2widget.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 QGSRENDERERV2WIDGET_H
16 #define QGSRENDERERV2WIDGET_H
17 
18 #include <QWidget>
19 #include <QMenu>
20 #include "qgssymbolv2.h"
21 
22 class QgsVectorLayer;
23 class QgsStyleV2;
26 
27 
38 class GUI_EXPORT QgsRendererV2Widget : public QWidget
39 {
40  Q_OBJECT
41  public:
43 
44  virtual ~QgsRendererV2Widget() {}
45 
47  virtual QgsFeatureRendererV2* renderer() = 0;
48 
50  void showSymbolLevelsDialog( QgsFeatureRendererV2* r );
51 
52  protected:
55  QMenu* contextMenu;
56  QAction* mCopyAction;
57  QAction* mPasteAction;
58 
61  virtual QList<QgsSymbolV2*> selectedSymbols() { return QList<QgsSymbolV2*>(); }
62  virtual void refreshSymbolView() {}
63 
64  protected slots:
65  void contextMenuViewCategories( const QPoint& p );
67  void changeSymbolColor();
69  void changeSymbolTransparency();
71  void changeSymbolUnit();
73  void changeSymbolWidth();
75  void changeSymbolSize();
76 
77  virtual void copy() {}
78  virtual void paste() {}
79 
80 };
81 
82 
84 
85 #include <QObject>
86 
87 class QMenu;
88 class QgsField;
89 class QgsFields;
90 
91 
95 class QgsRendererV2DataDefinedMenus : public QObject
96 {
97  Q_OBJECT
98 
99  public:
100 
101  QgsRendererV2DataDefinedMenus( QMenu* menu, QgsVectorLayer* layer, QString rotationField, QString sizeScaleField, QgsSymbolV2::ScaleMethod scaleMethod );
103 
104  void populateMenu( QMenu* menu, QString fieldName, QActionGroup *actionGroup );
105 #if 0
106  void updateMenu( QActionGroup* actionGroup, QString fieldName );
107 #endif
108  public slots:
109 
110  void rotationFieldSelected( QAction *a );
111  void sizeScaleFieldSelected( QAction *a );
112  void scaleMethodSelected( QAction *a );
113 
114  signals:
115 
116  void rotationFieldChanged( QString fldName );
117  void sizeScaleFieldChanged( QString fldName );
118  void scaleMethodChanged( QgsSymbolV2::ScaleMethod scaleMethod );
119 
120  protected:
123  QActionGroup *mSizeMethodActionGroup;
127 };
128 
129 #endif // QGSRENDERERV2WIDGET_H