Class: QgsAttributeTableDelegate

class qgis.gui.QgsAttributeTableDelegate(parent: QObject = None)

Bases: PyQt5.QtWidgets.QItemDelegate

Constructor

Parameters

parent (QObject = None) – parent object

A delegate item class for QgsAttributeTable (see Qt documentation for QItemDelegate).

Methods

childEvent

connectNotify

createEditor

Used to create an editor for when the user tries to change the contents of a cell

customEvent

disconnectNotify

drawBackground

drawCheck

drawDecoration

drawDisplay

drawFocus

editorEvent

eventFilter

isSignalConnected

paint

Overloads the paint method form the QItemDelegate base class

receivers

sender

senderSignalIndex

setEditorData

Sets data from model into the editor.

setFeatureSelectionModel

param featureSelectionModel

setModelData

Sets data from editor back to model.

timerEvent

Signals

actionColumnItemPainted

Emitted when an action column item is painted.

actionColumnItemPainted

Emitted when an action column item is painted. The consumer of this signal can initialize the index widget.

Note

This signal is emitted repeatedly whenever the item is being painted. It is the consumers responsibility to check if initialization has already happened before. [signal]

Parameters

index (QModelIndex) –

childEvent()
connectNotify()
createEditor(self, parent: QWidget, option: QStyleOptionViewItem, index: QModelIndex) → QWidget

Used to create an editor for when the user tries to change the contents of a cell

Parameters
  • parent (QWidget) –

  • option (QStyleOptionViewItem) –

  • index (QModelIndex) –

Return type

QWidget

customEvent()
disconnectNotify()
drawBackground()
drawCheck()
drawDecoration()
drawDisplay()
drawFocus()
editorEvent()
eventFilter()
isSignalConnected()
paint(self, painter: QPainter, option: QStyleOptionViewItem, index: QModelIndex)

Overloads the paint method form the QItemDelegate base class

Parameters
  • painter (QPainter) –

  • option (QStyleOptionViewItem) –

  • index (QModelIndex) –

receivers()
sender()
senderSignalIndex()
setEditorData(self, editor: QWidget, index: QModelIndex)

Sets data from model into the editor. Overloads default method

Parameters
  • editor (QWidget) – editor which was created by create editor function in this class

  • index (QModelIndex) – index of field which is to be retrieved

setFeatureSelectionModel(self, featureSelectionModel: QgsFeatureSelectionModel)
Parameters

featureSelectionModel (QgsFeatureSelectionModel) –

setModelData(self, editor: QWidget, model: QAbstractItemModel, index: QModelIndex)

Sets data from editor back to model. Overloads default method

Parameters
  • editor (QWidget) – editor which was created by create editor function in this class

  • model (QAbstractItemModel) – model where data should be updated

  • index (QModelIndex) – index of field which is to be modified

timerEvent()