Class: QgsAttributeTableDelegate¶
A delegate item class for QgsAttributeTable
(see Qt
documentation for QItemDelegate).
Class Hierarchy¶
Base classes¶
Methods
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsAttributeTableDelegate. See the FAQ for more details.
Used to create an editor for when the user tries to change the contents of a cell |
|
Overloads the paint method form the QItemDelegate base class |
|
Sets data from model into the editor. |
|
Sets data from editor back to model. |
Signals
Emitted when an action column item is painted. |
- class qgis.gui.QgsAttributeTableDelegate[source]¶
Bases:
QItemDelegate
- __init__(parent: QObject | None = None)
Constructor
- Parameters:
parent (Optional[QObject] = None) – parent object
- signal actionColumnItemPainted[source]¶
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.
- 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