Quantum GIS API Documentation  master-ce49b66
src/gui/attributetable/qgsattributetableview.h
Go to the documentation of this file.
00001 /***************************************************************************
00002      QgsAttributeTableView.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 QGSATTRIBUTETABLEVIEW_H
00017 #define QGSATTRIBUTETABLEVIEW_H
00018 
00019 #include <QTableView>
00020 #include <QAction>
00021 
00022 #include "qgsfeature.h" // For QgsFeatureIds
00023 
00024 class QgsAttributeTableModel;
00025 class QgsAttributeTableFilterModel;
00026 class QgsVectorLayerCache;
00027 class QgsFeatureSelectionModel;
00028 class QgsAttributeTableDelegate;
00029 class QgsMapCanvas;
00030 class QgsVectorLayer;
00031 class QMenu;
00032 class QProgressDialog;
00033 
00042 class GUI_EXPORT QgsAttributeTableView : public QTableView
00043 {
00044     Q_OBJECT
00045 
00046   public:
00047     QgsAttributeTableView( QWidget* parent = 0 );
00048     virtual ~QgsAttributeTableView();
00049 
00050     virtual void setModel( QgsAttributeTableFilterModel* filterModel );
00051 
00059     void setCanvasAndLayerCache( QgsMapCanvas *canvas, QgsVectorLayerCache *layerCache );
00060 
00071     virtual bool eventFilter( QObject* object, QEvent* event );
00072 
00073   protected:
00080     void mousePressEvent( QMouseEvent *event );
00081 
00088     void mouseReleaseEvent( QMouseEvent *event );
00089 
00096     void mouseMoveEvent( QMouseEvent *event );
00097 
00104     void keyPressEvent( QKeyEvent *event );
00105 
00113     void contextMenuEvent( QContextMenuEvent* event );
00114 
00119     void closeEvent( QCloseEvent *event );
00120 
00121   signals:
00130     void willShowContextMenu( QMenu* menu, QModelIndex atIndex );
00131 
00132     void finished();
00133 
00134   public slots:
00135     void repaintRequested( QModelIndexList indexes );
00136     void repaintRequested();
00137     virtual void selectAll();
00138     virtual void selectRow( int row );
00139     virtual void _q_selectRow( int row );
00140 
00141   private:
00142     void selectRow( int row, bool anchor );
00143     QgsAttributeTableModel* mMasterModel;
00144     QgsAttributeTableFilterModel* mFilterModel;
00145     QgsFeatureSelectionModel* mFeatureSelectionModel;
00146     QgsAttributeTableDelegate* mTableDelegate;
00147     QAbstractItemModel* mModel; // Most likely the filter model
00148     QMenu *mActionPopup;
00149     QgsVectorLayerCache* mLayerCache;
00150     int mRowSectionAnchor;
00151     QItemSelectionModel::SelectionFlag mCtrlDragSelectionFlag;
00152 };
00153 
00154 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines