Class: QgsAttributeTableDelegate

class qgis.gui.QgsAttributeTableDelegate

Bases: PyQt5.QtWidgets.QItemDelegate

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

QgsAttributeTableDelegate(parent: Optional[QObject] = None) Constructor

Parameters:

parent

parent object

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

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

actionColumnItemPainted

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...)

  • revision (int = ...)

  • arguments (Sequence = ...)

Return type:

PYQT_SIGNAL

childEvent(self, a0: QChildEvent | None)
connectNotify(self, signal: QMetaMethod)
createEditor(self, parent: QWidget | None, option: QStyleOptionViewItem, index: QModelIndex) QWidget | None

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

Parameters:
  • parent (Optional[QWidget])

  • option (QStyleOptionViewItem)

  • index (QModelIndex)

Return type:

Optional[QWidget]

customEvent(self, a0: QEvent | None)
disconnectNotify(self, signal: QMetaMethod)
drawBackground(self, painter: QPainter | None, option: QStyleOptionViewItem, index: QModelIndex)
drawCheck(self, painter: QPainter | None, option: QStyleOptionViewItem, rect: QRect, state: Qt.CheckState)
drawDecoration(self, painter: QPainter | None, option: QStyleOptionViewItem, rect: QRect, pixmap: QPixmap)
drawDisplay(self, painter: QPainter | None, option: QStyleOptionViewItem, rect: QRect, text: str | None)
drawFocus(self, painter: QPainter | None, option: QStyleOptionViewItem, rect: QRect)
editorEvent(self, event: QEvent | None, model: QAbstractItemModel | None, option: QStyleOptionViewItem, index: QModelIndex) bool
eventFilter(self, object: QObject | None, event: QEvent | None) bool
isSignalConnected(self, signal: QMetaMethod) bool
paint(self, painter: QPainter | None, option: QStyleOptionViewItem, index: QModelIndex)

Overloads the paint method form the QItemDelegate base class

Parameters:
  • painter (Optional[QPainter])

  • option (QStyleOptionViewItem)

  • index (QModelIndex)

receivers(self, signal: PYQT_SIGNAL) int
sender(self) QObject | None
senderSignalIndex(self) int
setEditorData(self, editor: QWidget | None, index: QModelIndex)

Sets data from model into the editor. Overloads default method

Parameters:
  • editor (Optional[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 | None)
Parameters:

featureSelectionModel (Optional[QgsFeatureSelectionModel])

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

Sets data from editor back to model. Overloads default method

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

  • model (Optional[QAbstractItemModel]) – model where data should be updated

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

timerEvent(self, a0: QTimerEvent | None)