![]() |
KVIrc 5.2.6
Developer APIs
|
Toolkit Abstraction Layer: itemdelegate class. More...
#include <KviTalIconAndRichTextItemDelegate.h>
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 |
Toolkit Abstraction Layer: itemdelegate class.
KviTalIconAndRichTextItemDelegate::KviTalIconAndRichTextItemDelegate | ( | QAbstractItemView * | pWidget = nullptr | ) |
Constructs the icon and rich text item delegate object.
pWidget | The item which we have to delegate for the paint |
References LVI_ICON_SIZE, m_oIconSize, m_oMinimumSize, and m_pParent.
Referenced by FileTransferItemDelegate::FileTransferItemDelegate(), and KviTopicListBoxItemDelegate::KviTopicListBoxItemDelegate().
|
default |
Destroys the icon and rich text item delegate object.
|
override |
Paints the view.
pPainter | The painter to draw the view |
option | The style options for the item |
index | The model index for the item |
References LVI_BORDER, LVI_SPACING, m_oDefaultPix, m_oIconSize, w, x, and y.
|
inline |
References m_oDefaultPix.
|
inline |
|
inline |
Set the size of the icons. Should be set in the view constructor.
References m_oIconSize, and 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.
|
override |
Returns the size hint for the view.
option | The style options for the item |
index | The model index for the item |
References h, LVI_AFTER_ICON, LVI_BORDER, m_oIconSize, m_oMinimumSize, and w.
|
protected |
Referenced by paint(), setDefaultIcon(), and setDefaultIcon().
|
protected |
Referenced by KviTalIconAndRichTextItemDelegate(), paint(), setIconSize(), and sizeHint().
|
protected |
Referenced by KviTalIconAndRichTextItemDelegate(), setMinimumSize(), and sizeHint().
|
protected |
Referenced by KviTalIconAndRichTextItemDelegate().