Class: QgsAttributeTableDelegate¶
- class qgis.gui.QgsAttributeTableDelegate¶
Bases:
PyQt5.QtWidgets.QItemDelegate
A delegate item class for
QgsAttributeTable
(see Qt documentation for QItemDelegate).QgsAttributeTableDelegate(parent: QObject = None) Constructor
- Parameters:
parent –
parent object
Methods
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.
- param featureSelectionModel:
Sets data from editor back to model.
Signals
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, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- 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(self, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- drawBackground(self, QPainter, QStyleOptionViewItem, QModelIndex)¶
- drawCheck(self, QPainter, QStyleOptionViewItem, QRect, Qt.CheckState)¶
- drawDecoration(self, QPainter, QStyleOptionViewItem, QRect, QPixmap)¶
- drawDisplay(self, QPainter, QStyleOptionViewItem, QRect, str)¶
- drawFocus(self, QPainter, QStyleOptionViewItem, QRect)¶
- editorEvent(self, QEvent, QAbstractItemModel, QStyleOptionViewItem, QModelIndex) bool ¶
- eventFilter(self, QObject, QEvent) bool ¶
- isSignalConnected(self, QMetaMethod) bool ¶
- 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(self, PYQT_SIGNAL) int ¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- 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(self, QTimerEvent)¶