Class: QgsAttributeTableDelegate

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

Class Hierarchy

Inheritance diagram of qgis.gui.QgsAttributeTableDelegate

Base classes

QItemDelegate

QAbstractItemDelegate

QObject

class qgis.gui.QgsAttributeTableDelegate[source]

Bases: QItemDelegate

__init__(parent: QObject | None = None)

Constructor

Parameters:

parent (Optional[QObject] = None) – parent object

signal actionColumnItemPainted[source]

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.

virtual createEditor(self, parent: QWidget | None, option: QStyleOptionViewItem, index: QModelIndex) QWidget | None[source]

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]

virtual paint(self, painter: QPainter | None, option: QStyleOptionViewItem, index: QModelIndex)[source]

Overloads the paint method form the QItemDelegate base class

Parameters:
  • painter (Optional[QPainter])

  • option (QStyleOptionViewItem)

  • index (QModelIndex)

virtual setEditorData(self, editor: QWidget | None, index: QModelIndex)[source]

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)[source]
Parameters:

featureSelectionModel (Optional[QgsFeatureSelectionModel])

virtual setModelData(self, editor: QWidget | None, model: QAbstractItemModel | None, index: QModelIndex)[source]

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