KVIrc 5.2.6
Developer APIs
KviTalIconAndRichTextItemDelegate Class Reference

Toolkit Abstraction Layer: itemdelegate class. More...

#include <KviTalIconAndRichTextItemDelegate.h>

+ Inheritance diagram for KviTalIconAndRichTextItemDelegate:

Public Member Functions

 KviTalIconAndRichTextItemDelegate (QAbstractItemView *pWidget=nullptr)
 Constructs the icon and rich text item delegate object.
 
void paint (QPainter *pPainter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Paints the view.
 
void setDefaultIcon (const QPixmap &oPix)
 
void setDefaultIcon (QPixmap *pPix)
 Sets the default icon.
 
void setIconSize (const QSize &s)
 Set the size of the icons. Should be set in the view constructor.
 
void setMinimumSize (const QSize &s)
 Set the absolute minimum size of the items. Should be set in the view constructor as QListWidget caches the size hints and works really hard to keep them unchanged.
 
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Returns the size hint for the view.
 
 ~KviTalIconAndRichTextItemDelegate ()
 Destroys the icon and rich text item delegate object.
 

Protected Attributes

QPixmap m_oDefaultPix
 
QSize m_oIconSize
 
QSize m_oMinimumSize
 
QAbstractItemView * m_pParent
 

Detailed Description

Toolkit Abstraction Layer: itemdelegate class.

Constructor & Destructor Documentation

◆ KviTalIconAndRichTextItemDelegate()

KviTalIconAndRichTextItemDelegate::KviTalIconAndRichTextItemDelegate ( QAbstractItemView * pWidget = nullptr)

Constructs the icon and rich text item delegate object.

Parameters
pWidgetThe item which we have to delegate for the paint
Returns
KviTalIconAndRichTextItemDelegate

References LVI_ICON_SIZE, m_oIconSize, m_oMinimumSize, and m_pParent.

Referenced by FileTransferItemDelegate::FileTransferItemDelegate(), and KviTopicListBoxItemDelegate::KviTopicListBoxItemDelegate().

◆ ~KviTalIconAndRichTextItemDelegate()

KviTalIconAndRichTextItemDelegate::~KviTalIconAndRichTextItemDelegate ( )
default

Destroys the icon and rich text item delegate object.

Member Function Documentation

◆ paint()

void KviTalIconAndRichTextItemDelegate::paint ( QPainter * pPainter,
const QStyleOptionViewItem & option,
const QModelIndex & index ) const
override

Paints the view.

Parameters
pPainterThe painter to draw the view
optionThe style options for the item
indexThe model index for the item
Returns
void

References LVI_BORDER, LVI_SPACING, m_oDefaultPix, m_oIconSize, w, x, and y.

◆ setDefaultIcon() [1/2]

void KviTalIconAndRichTextItemDelegate::setDefaultIcon ( const QPixmap & oPix)
inline

References m_oDefaultPix.

◆ setDefaultIcon() [2/2]

void KviTalIconAndRichTextItemDelegate::setDefaultIcon ( QPixmap * pPix)
inline

Sets the default icon.

Parameters
pPixThe icon pixmap
Returns
void

References m_oDefaultPix.

◆ setIconSize()

void KviTalIconAndRichTextItemDelegate::setIconSize ( const QSize & s)
inline

Set the size of the icons. Should be set in the view constructor.

References m_oIconSize, and s.

◆ setMinimumSize()

void KviTalIconAndRichTextItemDelegate::setMinimumSize ( const QSize & s)
inline

Set the absolute minimum size of the items. Should be set in the view constructor as QListWidget caches the size hints and works really hard to keep them unchanged.

References m_oMinimumSize, and s.

◆ sizeHint()

QSize KviTalIconAndRichTextItemDelegate::sizeHint ( const QStyleOptionViewItem & option,
const QModelIndex & index ) const
override

Returns the size hint for the view.

Parameters
optionThe style options for the item
indexThe model index for the item
Returns
QSize

References h, LVI_AFTER_ICON, LVI_BORDER, m_oIconSize, m_oMinimumSize, and w.

Member Data Documentation

◆ m_oDefaultPix

QPixmap KviTalIconAndRichTextItemDelegate::m_oDefaultPix
protected

◆ m_oIconSize

QSize KviTalIconAndRichTextItemDelegate::m_oIconSize
protected

◆ m_oMinimumSize

QSize KviTalIconAndRichTextItemDelegate::m_oMinimumSize
protected

◆ m_pParent

QAbstractItemView* KviTalIconAndRichTextItemDelegate::m_pParent
protected

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