Class: QgsAttributeTableView

class qgis.gui.QgsAttributeTableView(parent: QWidget = None)

Bases: PyQt5.QtWidgets.QTableView

Constructor for QgsAttributeTableView

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.

Parameters

parent

actionEvent()
changeEvent()
childEvent()
closeEditor()
closeEvent(self, event: QCloseEvent)

Saves geometry to the settings on close

Parameters

event (QCloseEvent) – not used

columnCountChanged()
columnMoved()
columnResized

Emitted when a column in the view has been resized.

Parameters
  • column – column index (starts at 0)

  • width – new width in pixel

New in version 2.16: [signal]

commitData()
connectNotify()
contextMenuEvent(self, event: QContextMenuEvent)

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

event (QContextMenuEvent) – The associated event object.

create()
currentChanged()
customEvent()
dataChanged()
destroy()
dirtyRegionOffset()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
drawFrame()
dropEvent()
dropIndicatorPosition()
edit()
editorDestroyed()
enterEvent()
event()
eventFilter(self, object: QObject, event: QEvent) → bool

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.

Parameters
  • object (QObject) – The object which is the target of the event.

  • event (QEvent) – The intercepted event

Return type

bool

Returns

Returns always false, so the event gets processed

executeDelayedItemsLayout()
finished

finished(self) [signal]

focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
horizontalOffset()
horizontalScrollbarAction()
horizontalScrollbarValueChanged()
initPainter()
initStyleOption()
inputMethodEvent()
isIndexHidden()
isSignalConnected()
keyPressEvent(self, event: QKeyEvent)

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

Parameters

event (QKeyEvent) – The mouse event

keyReleaseEvent()
leaveEvent()
metric()
mouseDoubleClickEvent()
mouseMoveEvent(self, event: QMouseEvent)

Called for mouse move events on a table cell. Disables selection change for these events.

Parameters

event (QMouseEvent) – The mouse event

mousePressEvent(self, event: QMouseEvent)

Called for mouse press events on a table cell. Disables selection change for these events.

Parameters

event (QMouseEvent) – The mouse event

mouseReleaseEvent(self, event: QMouseEvent)

Called for mouse release events on a table cell. Disables selection change for these events.

Parameters

event (QMouseEvent) – The mouse event

moveCursor()
moveEvent()
nativeEvent()
paintEvent()
receivers()
repaintRequested(self, indexes: object)

repaintRequested(self)

Parameters

indexes (object) –

resizeEvent()
rowCountChanged()
rowMoved()
rowResized()
rowsAboutToBeRemoved()
rowsInserted()
scheduleDelayedItemsLayout()
scrollContentsBy()
scrollDirtyRegion()
selectAll(self)
selectRow(self, row: int)
Parameters

row (int) –

selectedFeaturesIds(self) → object

Returns the selected features in the attribute table in table sorted order.

Return type

object

Returns

The selected features in the attribute table in the order sorted by the table.

New in version 3.4.

selectedIndexes()
selectionChanged()
selectionCommand()
sender()
senderSignalIndex()
setAttributeTableConfig(self, config: QgsAttributeTableConfig)

Set the attribute table config which should be used to control the appearance of the attribute table.

New in version 2.16.

Parameters

config (QgsAttributeTableConfig) –

setDirtyRegion()
setFeatureSelectionManager(self, featureSelectionManager: QgsIFeatureSelectionManager)

setFeatureSelectionManager

Parameters

featureSelectionManager (QgsIFeatureSelectionManager) – We will take ownership

setModel(self, filterModel: QgsAttributeTableFilterModel)
Parameters

filterModel (QgsAttributeTableFilterModel) –

setSelection()
setState()
setViewportMargins()
sharedPainter()
showEvent()
sizeHintForColumn()
sizeHintForRow()
startDrag()
state()
tabletEvent()
timerEvent()
updateEditorData()
updateEditorGeometries()
updateGeometries()
updateMicroFocus()
verticalOffset()
verticalScrollbarAction()
verticalScrollbarValueChanged()
viewOptions()
viewportEvent()
viewportMargins()
viewportSizeHint()
visualRegionForSelection()
wheelEvent()
willShowContextMenu

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

Parameters
  • 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 [signal]