QgsAttributeTableDelegate class

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

Constructors, destructors, conversion operators

QgsAttributeTableDelegate(QObject* parent = nullptr)
Constructor.

Public functions

auto createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const -> QWidget* override
Used to create an editor for when the user tries to change the contents of a cell.
void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override
Overloads the paint method form the QItemDelegate base class.
void setEditorData(QWidget* editor, const QModelIndex& index) const override
Sets data from model into the editor.
void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override
Sets data from editor back to model.

Signals

void actionColumnItemPainted(const QModelIndex& index) const
Is emitted when an action column item is painted.

Function documentation

QgsAttributeTableDelegate::QgsAttributeTableDelegate(QObject* parent = nullptr)

Constructor.

Parameters
parent parent object

void QgsAttributeTableDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const override

Sets data from model into the editor.

Parameters
editor editor which was created by create editor function in this class
index index of field which is to be retrieved

Overloads default method

void QgsAttributeTableDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override

Sets data from editor back to model.

Parameters
editor editor which was created by create editor function in this class
model model where data should be updated
index index of field which is to be modified

Overloads default method

void QgsAttributeTableDelegate::actionColumnItemPainted(const QModelIndex& index) const signal

Is emitted when an action column item is painted.

The consumer of this signal can initialize the index widget.