QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
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.
 

Public Member Functions

 QgsAttributeTableDelegate (QObject *parent=nullptr)
 Constructor.
 
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.
 
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 setFeatureSelectionModel (QgsFeatureSelectionModel *featureSelectionModel)
 
void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
 Sets data from editor back to model.
 

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 63 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 177 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 143 of file qgsattributetabledelegate.cpp.

◆ setFeatureSelectionModel()

void QgsAttributeTableDelegate::setFeatureSelectionModel ( QgsFeatureSelectionModel featureSelectionModel)

Definition at line 172 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 101 of file qgsattributetabledelegate.cpp.


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