QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsattributetableview.h
Go to the documentation of this file.
1 /***************************************************************************
2  QgsAttributeTableView.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 QGSATTRIBUTETABLEVIEW_H
17 #define QGSATTRIBUTETABLEVIEW_H
18 
19 #include <QTableView>
20 #include <QAction>
21 
22 #include "qgsfeature.h" // For QgsFeatureIds
23 
29 class QgsMapCanvas;
30 class QgsVectorLayer;
31 class QMenu;
32 class QProgressDialog;
33 
42 class GUI_EXPORT QgsAttributeTableView : public QTableView
43 {
44  Q_OBJECT
45 
46  public:
47  QgsAttributeTableView( QWidget* parent = 0 );
48  virtual ~QgsAttributeTableView();
49 
50  virtual void setModel( QgsAttributeTableFilterModel* filterModel );
51 
59  void setCanvasAndLayerCache( QgsMapCanvas *canvas, QgsVectorLayerCache *layerCache );
60 
71  virtual bool eventFilter( QObject* object, QEvent* event );
72 
73  protected:
80  void mousePressEvent( QMouseEvent *event );
81 
88  void mouseReleaseEvent( QMouseEvent *event );
89 
96  void mouseMoveEvent( QMouseEvent *event );
97 
104  void keyPressEvent( QKeyEvent *event );
105 
113  void contextMenuEvent( QContextMenuEvent* event );
114 
119  void closeEvent( QCloseEvent *event );
120 
121  signals:
130  void willShowContextMenu( QMenu* menu, QModelIndex atIndex );
131 
132  void finished();
133 
134  public slots:
135  void repaintRequested( QModelIndexList indexes );
136  void repaintRequested();
137  virtual void selectAll();
138  virtual void selectRow( int row );
139  virtual void _q_selectRow( int row );
140 
141  private:
142  void selectRow( int row, bool anchor );
147  QAbstractItemModel* mModel; // Most likely the filter model
148  QMenu *mActionPopup;
151  QItemSelectionModel::SelectionFlag mCtrlDragSelectionFlag;
152 };
153 
154 #endif