QGIS API Documentation  master-6164ace
src/gui/attributetable/qgsattributetabledelegate.h
Go to the documentation of this file.
00001 /***************************************************************************
00002      QgsAttributeTableDelegate.h
00003      --------------------------------------
00004     Date                 : Feb 2009
00005     Copyright            : (C) 2009 Vita Cizek
00006     Email                : weetya (at) gmail.com
00007  ***************************************************************************
00008  *                                                                         *
00009  *   This program is free software; you can redistribute it and/or modify  *
00010  *   it under the terms of the GNU General Public License as published by  *
00011  *   the Free Software Foundation; either version 2 of the License, or     *
00012  *   (at your option) any later version.                                   *
00013  *                                                                         *
00014  ***************************************************************************/
00015 
00016 #ifndef QGSATTRIBUTETABLEDELEGATE_H
00017 #define QGSATTRIBUTETABLEDELEGATE_H
00018 
00019 #include <QItemDelegate>
00020 #include "qgsfeature.h"
00021 
00022 class QgsFeatureSelectionModel;
00023 class QPainter;
00024 class QgsVectorLayer;
00025 class QgsAttributeTableView;
00026 
00032 class QgsAttributeTableDelegate : public QItemDelegate
00033 {
00034     Q_OBJECT;
00035 
00036     QgsVectorLayer *layer( const QAbstractItemModel *model ) const;
00037 
00038   public:
00042     QgsAttributeTableDelegate( QObject* parent = NULL ) :
00043         QItemDelegate( parent ) {};
00046     QWidget * createEditor(
00047       QWidget *parent,
00048       const QStyleOptionViewItem &option,
00049       const QModelIndex &index ) const;
00050 
00052     void paint(
00053       QPainter * painter,
00054       const QStyleOptionViewItem & option,
00055       const QModelIndex & index ) const;
00056 
00063     void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const;
00064 
00070     void setEditorData( QWidget *editor, const QModelIndex &index ) const;
00071 
00072     void setFeatureSelectionModel( QgsFeatureSelectionModel* featureSelectionModel );
00073 
00074   private:
00075     QgsFeatureSelectionModel* mFeatureSelectionModel;
00076 };
00077 
00078 #endif //QGSATTRIBUTETABLEDELEGATE_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines