QGIS API Documentation  2.9.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
QgsAttributeTableView Class Reference

Provides a table view of features of a QgsVectorLayer. More...

#include <qgsattributetableview.h>

Public Slots

virtual void _q_selectRow (int row)
void repaintRequested (QModelIndexList indexes)
void repaintRequested ()
virtual void selectAll () override
virtual void selectRow (int row)

Signals

void finished ()
void willShowContextMenu (QMenu *menu, QModelIndex atIndex)
 Is emitted, in order to provide a hook to add aditional menu entries to the context menu.

Public Member Functions

 QgsAttributeTableView (QWidget *parent=0)
virtual ~QgsAttributeTableView ()
virtual bool eventFilter (QObject *object, QEvent *event) override
 This event filter is installed on the verticalHeader to intercept mouse press and release events.
void setFeatureSelectionManager (QgsIFeatureSelectionManager *featureSelectionManager)
 setFeatureSelectionManager
virtual void setModel (QgsAttributeTableFilterModel *filterModel)

Protected Member Functions

void closeEvent (QCloseEvent *event) override
 Saves geometry to the settings on close.
void contextMenuEvent (QContextMenuEvent *event) override
 Is called when the context menu will be shown.
void keyPressEvent (QKeyEvent *event) override
 Called for key press events Disables selection change by only pressing an arrow key.
void mouseMoveEvent (QMouseEvent *event) override
 Called for mouse move events on a table cell.
void mousePressEvent (QMouseEvent *event) override
 Called for mouse press events on a table cell.
void mouseReleaseEvent (QMouseEvent *event) override
 Called for mouse release events on a table cell.

Detailed Description

Provides a table view of features of a QgsVectorLayer.

This can either be used as a standalone widget. QgsBrowser features a reference implementation. Or this can be used within the QgsDualView stacked widget.

Definition at line 44 of file qgsattributetableview.h.

Constructor & Destructor Documentation

QgsAttributeTableView::QgsAttributeTableView ( QWidget *  parent = 0)

Definition at line 33 of file qgsattributetableview.cpp.

QgsAttributeTableView::~QgsAttributeTableView ( )
virtual

Definition at line 64 of file qgsattributetableview.cpp.

Member Function Documentation

void QgsAttributeTableView::_q_selectRow ( int  row)
virtualslot

Definition at line 259 of file qgsattributetableview.cpp.

void QgsAttributeTableView::closeEvent ( QCloseEvent *  event)
overrideprotected

Saves geometry to the settings on close.

Parameters
eventnot used

Definition at line 156 of file qgsattributetableview.cpp.

void QgsAttributeTableView::contextMenuEvent ( QContextMenuEvent *  event)
overrideprotected

Is called when the context menu will be shown.

Emits a willShowContextMenu signal, so the menu can be populated by other parts of the application.

Parameters
eventThe associated event object.

Definition at line 226 of file qgsattributetableview.cpp.

bool QgsAttributeTableView::eventFilter ( QObject *  object,
QEvent *  event 
)
overridevirtual

This event filter is installed on the verticalHeader to intercept mouse press and release events.

These are used to disable / enable live synchronisation with the map canvas selection which can be slow due to recurring canvas repaints. Updating the

Parameters
objectThe object which is the target of the event.
eventThe intercepted event
Returns
Returns always false, so the event gets processed

Definition at line 92 of file qgsattributetableview.cpp.

void QgsAttributeTableView::finished ( )
signal
void QgsAttributeTableView::keyPressEvent ( QKeyEvent *  event)
overrideprotected

Called for key press events Disables selection change by only pressing an arrow key.

Parameters
eventThe mouse event

Definition at line 184 of file qgsattributetableview.cpp.

void QgsAttributeTableView::mouseMoveEvent ( QMouseEvent *  event)
overrideprotected

Called for mouse move events on a table cell.

Disables selection change for these events.

Parameters
eventThe mouse event

Definition at line 177 of file qgsattributetableview.cpp.

void QgsAttributeTableView::mousePressEvent ( QMouseEvent *  event)
overrideprotected

Called for mouse press events on a table cell.

Disables selection change for these events.

Parameters
eventThe mouse event

Definition at line 163 of file qgsattributetableview.cpp.

void QgsAttributeTableView::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotected

Called for mouse release events on a table cell.

Disables selection change for these events.

Parameters
eventThe mouse event

Definition at line 170 of file qgsattributetableview.cpp.

void QgsAttributeTableView::repaintRequested ( QModelIndexList  indexes)
slot

Definition at line 206 of file qgsattributetableview.cpp.

void QgsAttributeTableView::repaintRequested ( )
slot

Definition at line 214 of file qgsattributetableview.cpp.

void QgsAttributeTableView::selectAll ( )
overridevirtualslot

Definition at line 219 of file qgsattributetableview.cpp.

void QgsAttributeTableView::selectRow ( int  row)
virtualslot

Definition at line 254 of file qgsattributetableview.cpp.

void QgsAttributeTableView::setFeatureSelectionManager ( QgsIFeatureSelectionManager featureSelectionManager)

setFeatureSelectionManager

Parameters
featureSelectionManagerWe will take ownership

Definition at line 145 of file qgsattributetableview.cpp.

void QgsAttributeTableView::setModel ( QgsAttributeTableFilterModel filterModel)
virtual

Definition at line 113 of file qgsattributetableview.cpp.

void QgsAttributeTableView::willShowContextMenu ( QMenu *  menu,
QModelIndex  atIndex 
)
signal

Is emitted, in order to provide a hook to add aditional menu entries to the context menu.

Parameters
menuIf additional QMenuItems are added, they will show up in the context menu.
atIndexThe QModelIndex, to which the context menu belongs. Relative to the source model. In most cases, this will be a QgsAttributeTableFilterModel

The documentation for this class was generated from the following files: