QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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;
32 class QMenu;
33 class QProgressDialog;
34 
35 
44 class GUI_EXPORT QgsAttributeTableView : public QTableView
45 {
46  Q_OBJECT
47 
48  public:
49  QgsAttributeTableView( QWidget* parent = 0 );
50  virtual ~QgsAttributeTableView();
51 
52  virtual void setModel( QgsAttributeTableFilterModel* filterModel );
53 
58  void setFeatureSelectionManager( QgsIFeatureSelectionManager* featureSelectionManager );
59 
70  virtual bool eventFilter( QObject* object, QEvent* event );
71 
72  protected:
79  void mousePressEvent( QMouseEvent *event );
80 
87  void mouseReleaseEvent( QMouseEvent *event );
88 
95  void mouseMoveEvent( QMouseEvent *event );
96 
103  void keyPressEvent( QKeyEvent *event );
104 
112  void contextMenuEvent( QContextMenuEvent* event );
113 
118  void closeEvent( QCloseEvent *event );
119 
120  signals:
129  void willShowContextMenu( QMenu* menu, QModelIndex atIndex );
130 
131  void finished();
132 
133  public slots:
134  void repaintRequested( QModelIndexList indexes );
135  void repaintRequested();
136  virtual void selectAll();
137  virtual void selectRow( int row );
138  virtual void _q_selectRow( int row );
139 
140  private:
141  void selectRow( int row, bool anchor );
142  QgsAttributeTableModel* mMasterModel;
143  QgsAttributeTableFilterModel* mFilterModel;
144  QgsFeatureSelectionModel* mFeatureSelectionModel;
145  QgsIFeatureSelectionManager* mFeatureSelectionManager;
146  QgsAttributeTableDelegate* mTableDelegate;
147  QAbstractItemModel* mModel; // Most likely the filter model
148  QMenu *mActionPopup;
149  QgsVectorLayerCache* mLayerCache;
150  int mRowSectionAnchor;
151  QItemSelectionModel::SelectionFlag mCtrlDragSelectionFlag;
152 };
153 
154 #endif
Provides a table view of features of a QgsVectorLayer.
Definition: qgsattributetableview.h:44
Definition: qgsattributetablefiltermodel.h:31
A model backed by a QgsVectorLayerCache which is able to provide feature/attribute information to a Q...
Definition: qgsattributetablemodel.h:45
Definition: qgsfeatureselectionmodel.h:12
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:104
This class caches features of a given QgsVectorLayer.
Definition: qgsvectorlayercache.h:38
A delegate item class for QgsAttributeTable (see Qt documentation for QItemDelegate).
Definition: qgsattributetabledelegate.h:32
Is an interface class to abstract feature selection handling.
Definition: qgsifeatureselectionmanager.h:29
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:470