itom
Loading...
Searching...
No Matches
QVariantDelegate Class Reference

#include <QVariantDelegate.h>

Inheritance diagram for QVariantDelegate:

Public Member Functions

 QVariantDelegate (QObject *parent=0)
 
virtual ~QVariantDelegate ()
 Destructor.
 
QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
 
virtual void setEditorData (QWidget *editor, const QModelIndex &index) const
 
virtual void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
 
virtual void updateEditorGeometry (QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
 QItemDelegate implementation.
 
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const
 
 QVariantDelegate (QObject *parent=0)
 
virtual ~QVariantDelegate ()
 Destructor.
 
QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
 
virtual void setEditorData (QWidget *editor, const QModelIndex &index) const
 
virtual void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
 
virtual void updateEditorGeometry (QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
 QItemDelegate implementation.
 

Protected Member Functions

PropertypropertyFromModel (const QModelIndex &index) const
 

Private Member Functions

void parseEditorHints (QWidget *editor, const QString &editorHints) const
 
void parseEditorHints (QWidget *editor, const QString &editorHints) const
 

Private Attributes

QSignalMapper * m_finishedMapper
 

Detailed Description

This class is used to create the editor widgets for datatypes encapsulated in QVariant variables

Constructor & Destructor Documentation

◆ QVariantDelegate() [1/2]

QVariantDelegate::QVariantDelegate ( QObject * parent = 0)

Constructor

Parameters
parentoptional parent object

◆ QVariantDelegate() [2/2]

QVariantDelegate::QVariantDelegate ( QObject * parent = 0)

Constructor

Parameters
parentoptional parent object

Member Function Documentation

◆ createEditor() [1/2]

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

Creates an editor widget as child of a given widget for a specific QModelIndex

Parameters
parentthe parent widget for the editor
optionsome style options that the editor should use
indexthe index of the item the editor will be created for
Returns
QWidget the editor widget

◆ createEditor() [2/2]

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

Creates an editor widget as child of a given widget for a specific QModelIndex

Parameters
parentthe parent widget for the editor
optionsome style options that the editor should use
indexthe index of the item the editor will be created for
Returns
QWidget the editor widget

◆ setEditorData() [1/2]

void QVariantDelegate::setEditorData ( QWidget * editor,
const QModelIndex & index ) const
virtual

Tries to set the editor data based on the value stored at a specific QModelIndex

Parameters
editorthe editor widget
indexthe model index of the value that should be used in the editor

◆ setEditorData() [2/2]

virtual void QVariantDelegate::setEditorData ( QWidget * editor,
const QModelIndex & index ) const
virtual

Tries to set the editor data based on the value stored at a specific QModelIndex

Parameters
editorthe editor widget
indexthe model index of the value that should be used in the editor

◆ setModelData() [1/2]

void QVariantDelegate::setModelData ( QWidget * editor,
QAbstractItemModel * model,
const QModelIndex & index ) const
virtual

Sets the data of a specific QModelIndex to the value of the editor widget

Parameters
editorthe editor widget that contains the new value
modelthe model that contains the index
indexthe index within the model whose data value should be set to the data value of the editor

◆ setModelData() [2/2]

virtual void QVariantDelegate::setModelData ( QWidget * editor,
QAbstractItemModel * model,
const QModelIndex & index ) const
virtual

Sets the data of a specific QModelIndex to the value of the editor widget

Parameters
editorthe editor widget that contains the new value
modelthe model that contains the index
indexthe index within the model whose data value should be set to the data value of the editor

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