Quark  0.1
ImageAndTextDelegate Class Reference

An item delegate that displays an image and some text. More...

#include <ImageAndTextDelegate.h++>

Inheritance diagram for ImageAndTextDelegate:

Public Member Functions

 ImageAndTextDelegate (const QSize &iconSize, QObject *parent=NULL)
 Constructs a new ImageAndTextDelegate with the given image size. More...
 
virtual void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
 Specified by QAbstractItemDelegate. More...
 
virtual QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const
 Specified by QAbstractItemDelegate. More...
 

Detailed Description

An item delegate that displays an image and some text.

Author
Mark Lindner

Constructor & Destructor Documentation

◆ ImageAndTextDelegate()

ImageAndTextDelegate ( const QSize &  iconSize,
QObject *  parent = NULL 
)
explicit

Constructs a new ImageAndTextDelegate with the given image size.

The text is taken from the model item's display role and the image (QIcon) is taken from the model item's decoration role.

Parameters
iconSizeThe image size.

Member Function Documentation

◆ paint()

virtual void paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
virtual

Specified by QAbstractItemDelegate.

◆ sizeHint()

virtual QSize sizeHint ( const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
virtual

Specified by QAbstractItemDelegate.


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