KVIrc  4.9.2
DeveloperAPIs
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=0)
 Constructs the icon and rich text item delegate object. More...
 
void paint (QPainter *pPainter, const QStyleOptionViewItem &option, const QModelIndex &index) const
 Paints the view. More...
 
void setDefaultIcon (QPixmap *pPix)
 Sets the default icon. More...
 
void setDefaultIcon (const QPixmap &oPix)
 
void setIconSize (const QSize &s)
 Set the size of the icons. Should be set in the view constructor. More...
 
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. More...
 
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const
 Returns the size hint for the view. More...
 
 ~KviTalIconAndRichTextItemDelegate ()
 Destroys the icon and rich text item delegate object. More...
 

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 ( QAbstractItemView *  pWidget = 0)

Constructs the icon and rich text item delegate object.

Parameters
pWidgetThe item which we have to delegate for the paint
Returns
KviTalIconAndRichTextItemDelegate
KviTalIconAndRichTextItemDelegate::~KviTalIconAndRichTextItemDelegate ( )
default

Destroys the icon and rich text item delegate object.

Member Function Documentation

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

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.

void KviTalIconAndRichTextItemDelegate::setDefaultIcon ( QPixmap *  pPix)
inline

Sets the default icon.

Parameters
pPixThe icon pixmap
Returns
void

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

void KviTalIconAndRichTextItemDelegate::setDefaultIcon ( const QPixmap &  oPix)
inline
void KviTalIconAndRichTextItemDelegate::setIconSize ( const QSize &  s)
inline

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

References s.

Referenced by ThemeManagementDialog::ThemeManagementDialog().

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 ThemeManagementDialog::ThemeManagementDialog().

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

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

QPixmap KviTalIconAndRichTextItemDelegate::m_oDefaultPix
protected

Referenced by paint().

QSize KviTalIconAndRichTextItemDelegate::m_oIconSize
protected

Referenced by paint(), and sizeHint().

QSize KviTalIconAndRichTextItemDelegate::m_oMinimumSize
protected

Referenced by sizeHint().

QAbstractItemView* KviTalIconAndRichTextItemDelegate::m_pParent
protected

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