KVIrc 5.2.0
Developer APIs
Public Member Functions | Protected Attributes | List of all members
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

◆ ~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

◆ setDefaultIcon() [2/2]

void KviTalIconAndRichTextItemDelegate::setDefaultIcon ( QPixmap *  pPix)
inline

◆ setIconSize()

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

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

References s.

Referenced by KviWebPackageManagementDialog::KviWebPackageManagementDialog(), and ThemeManagementDialog::ThemeManagementDialog().

◆ 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 s.

Referenced by KviWebPackageManagementDialog::KviWebPackageManagementDialog(), and ThemeManagementDialog::ThemeManagementDialog().

◆ 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

Referenced by paint().

◆ m_oIconSize

QSize KviTalIconAndRichTextItemDelegate::m_oIconSize
protected

Referenced by paint(), and sizeHint().

◆ m_oMinimumSize

QSize KviTalIconAndRichTextItemDelegate::m_oMinimumSize
protected

Referenced by sizeHint().

◆ m_pParent

QAbstractItemView* KviTalIconAndRichTextItemDelegate::m_pParent
protected

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