QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsattributetabledelegate.h
Go to the documentation of this file.
1 /***************************************************************************
2  QgsAttributeTableDelegate.h
3  --------------------------------------
4  Date : Feb 2009
5  Copyright : (C) 2009 Vita Cizek
6  Email : weetya (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 QGSATTRIBUTETABLEDELEGATE_H
17 #define QGSATTRIBUTETABLEDELEGATE_H
18 
19 #include <QItemDelegate>
20 #include "qgsfeature.h"
21 
23 class QPainter;
24 class QgsVectorLayer;
26 
32 class GUI_EXPORT QgsAttributeTableDelegate : public QItemDelegate
33 {
34  Q_OBJECT;
35 
36  QgsVectorLayer *layer( const QAbstractItemModel *model ) const;
37 
38  public:
42  QgsAttributeTableDelegate( QObject* parent = NULL ) :
43  QItemDelegate( parent ) {};
46  QWidget * createEditor(
47  QWidget *parent,
48  const QStyleOptionViewItem &option,
49  const QModelIndex &index ) const;
50 
52  void paint(
53  QPainter * painter,
54  const QStyleOptionViewItem & option,
55  const QModelIndex & index ) const;
56 
63  void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const;
64 
70  void setEditorData( QWidget *editor, const QModelIndex &index ) const;
71 
72  void setFeatureSelectionModel( QgsFeatureSelectionModel* featureSelectionModel );
73 
74  private:
76 };
77 
78 #endif //QGSATTRIBUTETABLEDELEGATE_H