QGIS API Documentation
2.2.0-Valmiera
|
Provides a table view of features of a QgsVectorLayer. More...
#include <qgsattributetableview.h>
Public Slots | |
void | repaintRequested (QModelIndexList indexes) |
void | repaintRequested () |
virtual void | selectAll () |
virtual void | selectRow (int row) |
virtual void | _q_selectRow (int row) |
Signals | |
void | willShowContextMenu (QMenu *menu, QModelIndex atIndex) |
Is emitted, in order to provide a hook to add aditional menu entries to the context menu. | |
void | finished () |
Public Member Functions | |
QgsAttributeTableView (QWidget *parent=0) | |
virtual | ~QgsAttributeTableView () |
virtual void | setModel (QgsAttributeTableFilterModel *filterModel) |
void | setFeatureSelectionManager (QgsIFeatureSelectionManager *featureSelectionManager) |
setFeatureSelectionManager | |
virtual bool | eventFilter (QObject *object, QEvent *event) |
This event filter is installed on the verticalHeader to intercept mouse press and release events. |
Protected Member Functions | |
void | mousePressEvent (QMouseEvent *event) |
Called for mouse press events on a table cell. | |
void | mouseReleaseEvent (QMouseEvent *event) |
Called for mouse release events on a table cell. | |
void | mouseMoveEvent (QMouseEvent *event) |
Called for mouse move events on a table cell. | |
void | keyPressEvent (QKeyEvent *event) |
Called for key press events Disables selection change by only pressing an arrow key. | |
void | contextMenuEvent (QContextMenuEvent *event) |
Is called when the context menu will be shown. | |
void | closeEvent (QCloseEvent *event) |
Saves geometry to the settings on close. |
Private Member Functions | |
void | selectRow (int row, bool anchor) |
Private Attributes | |
QgsAttributeTableModel * | mMasterModel |
QgsAttributeTableFilterModel * | mFilterModel |
QgsFeatureSelectionModel * | mFeatureSelectionModel |
QgsIFeatureSelectionManager * | mFeatureSelectionManager |
QgsAttributeTableDelegate * | mTableDelegate |
QAbstractItemModel * | mModel |
QMenu * | mActionPopup |
QgsVectorLayerCache * | mLayerCache |
int | mRowSectionAnchor |
QItemSelectionModel::SelectionFlag | mCtrlDragSelectionFlag |
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.
QgsAttributeTableView::QgsAttributeTableView | ( | QWidget * | parent = 0 | ) |
Definition at line 33 of file qgsattributetableview.cpp.
References _q_selectRow(), mTableDelegate, and selectRow().
|
virtual |
Definition at line 60 of file qgsattributetableview.cpp.
References mActionPopup.
|
virtualslot |
Definition at line 259 of file qgsattributetableview.cpp.
References selectRow().
Referenced by QgsAttributeTableView().
|
protected |
Saves geometry to the settings on close.
event | not used |
Definition at line 153 of file qgsattributetableview.cpp.
|
protected |
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.
event | The associated event object. |
Definition at line 223 of file qgsattributetableview.cpp.
References QgsAttributeTableFilterModel::layer(), mActionPopup, mFilterModel, selectAll(), tr, and willShowContextMenu().
|
virtual |
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
object | The object which is the target of the event. |
event | The intercepted event |
Definition at line 91 of file qgsattributetableview.cpp.
References QgsFeatureSelectionModel::enableSync(), and mFeatureSelectionModel.
|
signal |
|
protected |
Called for key press events Disables selection change by only pressing an arrow key.
event | The mouse event |
Definition at line 181 of file qgsattributetableview.cpp.
|
protected |
Called for mouse move events on a table cell.
Disables selection change for these events.
event | The mouse event |
Definition at line 174 of file qgsattributetableview.cpp.
|
protected |
Called for mouse press events on a table cell.
Disables selection change for these events.
event | The mouse event |
Definition at line 160 of file qgsattributetableview.cpp.
|
protected |
Called for mouse release events on a table cell.
Disables selection change for these events.
event | The mouse event |
Definition at line 167 of file qgsattributetableview.cpp.
|
slot |
Definition at line 203 of file qgsattributetableview.cpp.
References index.
|
slot |
Definition at line 211 of file qgsattributetableview.cpp.
Referenced by setModel().
|
virtualslot |
Definition at line 216 of file qgsattributetableview.cpp.
References mFeatureSelectionModel, mFilterModel, and QgsFeatureSelectionModel::selectFeatures().
Referenced by contextMenuEvent().
|
virtualslot |
Definition at line 254 of file qgsattributetableview.cpp.
Referenced by _q_selectRow(), and QgsAttributeTableView().
|
private |
Definition at line 264 of file qgsattributetableview.cpp.
References index, QgsFeatureSelectionModel::isSelected(), mCtrlDragSelectionFlag, mFeatureSelectionModel, mRowSectionAnchor, and QgsFeatureSelectionModel::selectFeatures().
void QgsAttributeTableView::setFeatureSelectionManager | ( | QgsIFeatureSelectionManager * | featureSelectionManager | ) |
setFeatureSelectionManager
featureSelectionManager | We will take ownership |
Definition at line 142 of file qgsattributetableview.cpp.
References mFeatureSelectionManager, mFeatureSelectionModel, and QgsFeatureSelectionModel::setFeatureSelectionManager().
|
virtual |
Definition at line 112 of file qgsattributetableview.cpp.
References QgsAttributeTableFilterModel::layer(), mFeatureSelectionManager, mFeatureSelectionModel, mFilterModel, mTableDelegate, repaintRequested(), and QgsAttributeTableDelegate::setFeatureSelectionModel().
|
signal |
Is emitted, in order to provide a hook to add aditional menu entries to the context menu.
menu | If additional QMenuItems are added, they will show up in the context menu. |
atIndex | The QModelIndex, to which the context menu belongs. Relative to the source model. In most cases, this will be a QgsAttributeTableFilterModel |
Referenced by contextMenuEvent().
|
private |
Definition at line 148 of file qgsattributetableview.h.
Referenced by contextMenuEvent(), and ~QgsAttributeTableView().
|
private |
Definition at line 151 of file qgsattributetableview.h.
Referenced by selectRow().
|
private |
Definition at line 145 of file qgsattributetableview.h.
Referenced by setFeatureSelectionManager(), and setModel().
|
private |
Definition at line 144 of file qgsattributetableview.h.
Referenced by eventFilter(), selectAll(), selectRow(), setFeatureSelectionManager(), and setModel().
|
private |
Definition at line 143 of file qgsattributetableview.h.
Referenced by contextMenuEvent(), selectAll(), and setModel().
|
private |
Definition at line 149 of file qgsattributetableview.h.
|
private |
Definition at line 142 of file qgsattributetableview.h.
|
private |
Definition at line 147 of file qgsattributetableview.h.
|
private |
Definition at line 150 of file qgsattributetableview.h.
Referenced by selectRow().
|
private |
Definition at line 146 of file qgsattributetableview.h.
Referenced by QgsAttributeTableView(), and setModel().