QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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
virtual void paste()
Definition: qgsrendererv2widget.h:78
virtual QList< QgsSymbolV2 * > selectedSymbols()
Subclasses may provide the capability of changing multiple symbols at once by implementing the follow...
Definition: qgsrendererv2widget.h:61
QActionGroup * mRotationAttributeActionGroup
Definition: qgsrendererv2widget.h:124
virtual ~QgsRendererV2Widget()
Definition: qgsrendererv2widget.h:44
QAction * mCopyAction
Definition: qgsrendererv2widget.h:56
Definition: qgssymbolv2selectordialog.h:35
Container of fields for a vector layer.
Definition: qgsfield.h:172
void populateMenu(QMenu *menu, QString fieldName, QActionGroup *actionGroup)
Definition: qgsrendererv2widget.cpp:233
Utility class for providing GUI for data-defined rendering.
Definition: qgsrendererv2widget.h:95
QgsVectorLayer * mLayer
Definition: qgsrendererv2widget.h:53
QgsStyleV2 * mStyle
Definition: qgsrendererv2widget.h:54
void rotationFieldSelected(QAction *a)
Definition: qgsrendererv2widget.cpp:277
QMenu * mRotationMenu
Definition: qgsrendererv2widget.h:121
void rotationFieldChanged(QString fldName)
Encapsulate a field in an attribute table or data source.
Definition: qgsfield.h:33
QMenu * mSizeScaleMenu
Definition: qgsrendererv2widget.h:122
void scaleMethodChanged(QgsSymbolV2::ScaleMethod scaleMethod)
QActionGroup * mSizeAttributeActionGroup
Definition: qgsrendererv2widget.h:125
virtual void copy()
Definition: qgsrendererv2widget.h:77
Definition: qgsstylev2.h:66
~QgsRendererV2DataDefinedMenus()
Definition: qgsrendererv2widget.cpp:224
QActionGroup * mSizeMethodActionGroup
Definition: qgsrendererv2widget.h:123
void sizeScaleFieldSelected(QAction *a)
Definition: qgsrendererv2widget.cpp:304
ScaleMethod
Definition: qgssymbolv2.h:61
void sizeScaleFieldChanged(QString fldName)
Base class for renderer settings widgets.
Definition: qgsrendererv2widget.h:38
QMenu * contextMenu
Definition: qgsrendererv2widget.h:55
Definition: qgsrendererv2.h:72
QAction * mPasteAction
Definition: qgsrendererv2widget.h:57
virtual void refreshSymbolView()
Definition: qgsrendererv2widget.h:62
QgsRendererV2DataDefinedMenus(QMenu *menu, QgsVectorLayer *layer, QString rotationField, QString sizeScaleField, QgsSymbolV2::ScaleMethod scaleMethod)
Definition: qgsrendererv2widget.cpp:184
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:470
QgsVectorLayer * mLayer
Definition: qgsrendererv2widget.h:126
void scaleMethodSelected(QAction *a)
Definition: qgsrendererv2widget.cpp:331