Subgroup: Attribute

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.

Methods

actionEvent
changeEvent
childEvent
closeEditor
closeEvent Saves geometry to the settings on close
columnCountChanged
columnMoved
commitData
connectNotify
contextMenuEvent Is called when the context menu will be shown.
create
currentChanged
customEvent
dataChanged
destroy
dirtyRegionOffset
disconnectNotify
dragEnterEvent
dragLeaveEvent
dragMoveEvent
drawFrame
dropEvent
dropIndicatorPosition
edit
editorDestroyed
enterEvent
event
eventFilter This event filter is installed on the verticalHeader to intercept mouse press and release events.
executeDelayedItemsLayout
focusInEvent
focusNextChild
focusNextPrevChild
focusOutEvent
focusPreviousChild
hideEvent
horizontalOffset
horizontalScrollbarAction
horizontalScrollbarValueChanged
initPainter
initStyleOption
inputMethodEvent
isIndexHidden
isSignalConnected
keyPressEvent Called for key press events Disables selection change by only pressing an arrow key
keyReleaseEvent
leaveEvent
metric
mouseDoubleClickEvent
mouseMoveEvent Called for mouse move events on a table cell.
mousePressEvent Called for mouse press events on a table cell.
mouseReleaseEvent Called for mouse release events on a table cell.
moveCursor
moveEvent
nativeEvent
paintEvent
receivers
repaintRequested repaintRequested(self)
resizeEvent
rowCountChanged
rowMoved
rowResized
rowsAboutToBeRemoved
rowsInserted
scheduleDelayedItemsLayout
scrollContentsBy
scrollDirtyRegion
selectAll
selectRow
selectedFeaturesIds Returns the selected features in the attribute table in table sorted order.
selectedIndexes
selectionChanged
selectionCommand
sender
senderSignalIndex
setAttributeTableConfig Set the attribute table config which should be used to control the appearance of the attribute table.
setDirtyRegion
setFeatureSelectionManager setFeatureSelectionManager
setModel
setSelection
setState
setViewportMargins
sharedPainter
showEvent
sizeHintForColumn
sizeHintForRow
startDrag
state
tabletEvent
timerEvent
updateEditorData
updateEditorGeometries
updateGeometries
updateMicroFocus
verticalOffset
verticalScrollbarAction
verticalScrollbarValueChanged
viewOptions
viewportEvent
viewportMargins
viewportSizeHint
visualRegionForSelection
wheelEvent

Signals

columnResized Emitted when a column in the view has been resized.
finished finished(self) [signal]
willShowContextMenu Is emitted, in order to provide a hook to add additional* menu entries to the context menu.

Attributes

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

Saves geometry to the settings on close

Parameters:event – 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 – 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 – The object which is the target of the event.
  • event – The intercepted event
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 – 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 – The mouse event
mousePressEvent(self, event: QMouseEvent)

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

Parameters:event – The mouse event
mouseReleaseEvent(self, event: QMouseEvent)

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

Parameters:event – The mouse event
moveCursor()
moveEvent()
nativeEvent()
paintEvent()
receivers()
repaintRequested(self, indexes: object)

repaintRequested(self)

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

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

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.

setDirtyRegion()
setFeatureSelectionManager(self, featureSelectionManager: QgsIFeatureSelectionManager)

setFeatureSelectionManager

Parameters:featureSelectionManager – We will take ownership
setModel(self, 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]