QGIS API Documentation  2.3.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsattributeeditorcontext.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsattributeeditorcontext.h
3  --------------------------------------
4  Date : 30.7.2013
5  Copyright : (C) 2013 Matthias Kuhn
6  Email : matthias dot kuhn at gmx dot ch
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 QGSATTRIBUTEEDITORCONTEXT_H
17 #define QGSATTRIBUTEEDITORCONTEXT_H
18 
19 #include <QMap>
20 #include <QWidget>
21 
22 #include <qgsdistancearea.h>
23 #include <qgsvectorlayer.h>
24 #include <qgsvectorlayertools.h>
25 
26 
33 class GUI_EXPORT QgsAttributeEditorContext
34 {
35  public:
37 
38  QWidget* proxyWidget( QgsVectorLayer* vl, int fieldIdx );
40  void addProxyWidgets( QgsVectorLayer* vl, QMap<int, QWidget*> proxyWidgets );
41  void addProxyWidget( QgsVectorLayer* vl, int idx, QWidget* widget );
42 
43  void setDistanceArea( const QgsDistanceArea& distanceArea ) { mDistanceArea = distanceArea; }
44  inline const QgsDistanceArea& distanceArea() { return mDistanceArea; }
45 
46  void setVectorLayerTools( QgsVectorLayerTools* vlTools ) { mVectorLayerTools = vlTools; }
47  QgsVectorLayerTools* vectorLayerTools() { return mVectorLayerTools; }
48 
55  void adjustForLayer( QgsVectorLayer* layer );
56 
57 
58  private:
60 
62  QMap<QgsVectorLayer*, QMap<int, QWidget*> > mProxyWidgets;
63 
65 };
66 
67 #endif // QGSATTRIBUTEEDITORCONTEXT_H
Methods in this class are used to handle basic operations on vector layers.
This class contains context information for attribute editor widgets.
QMap< QgsVectorLayer *, QMap< int, QWidget * > > mProxyWidgets
vectorlayer => ( fieldIdx, proxyWidget )
void setVectorLayerTools(QgsVectorLayerTools *vlTools)
QgsVectorLayerTools * vectorLayerTools()
void setDistanceArea(const QgsDistanceArea &distanceArea)
General purpose distance and area calculator.
QgsVectorLayerTools * mVectorLayerTools
Represents a vector layer which manages a vector based data sets.
const QgsDistanceArea & distanceArea()