QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
Signals | Public Member Functions | List of all members
QgsAttributeTableDelegate Class Reference

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

#include <qgsattributetabledelegate.h>

Inheritance diagram for QgsAttributeTableDelegate:
Inheritance graph
[legend]

Signals

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

Public Member Functions

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

Detailed Description

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

Definition at line 35 of file qgsattributetabledelegate.h.

Constructor & Destructor Documentation

◆ QgsAttributeTableDelegate()

QgsAttributeTableDelegate::QgsAttributeTableDelegate ( QObject *  parent = nullptr)
inline

Constructor.

Parameters
parentparent object

Definition at line 48 of file qgsattributetabledelegate.h.

Member Function Documentation

◆ actionColumnItemPainted

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

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.

◆ createEditor()

QWidget * QgsAttributeTableDelegate::createEditor ( QWidget *  parent,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

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

Definition at line 62 of file qgsattributetabledelegate.cpp.

◆ paint()

void QgsAttributeTableDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

Overloads the paint method form the QItemDelegate base class.

Definition at line 176 of file qgsattributetabledelegate.cpp.

◆ setEditorData()

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

Sets data from model into the editor.

Overloads default method

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

Definition at line 142 of file qgsattributetabledelegate.cpp.

◆ setFeatureSelectionModel()

void QgsAttributeTableDelegate::setFeatureSelectionModel ( QgsFeatureSelectionModel featureSelectionModel)

Definition at line 171 of file qgsattributetabledelegate.cpp.

◆ setModelData()

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

Sets data from editor back to model.

Overloads default method

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

Definition at line 100 of file qgsattributetabledelegate.cpp.


The documentation for this class was generated from the following files: