StatusEventItemDelegate Class Reference

#include <StatusEventItemDelegate.h>

List of all members.

Public Member Functions

 StatusEventItemDelegate (QObject *parent=0)
virtual void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
virtual QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const

Static Protected Member Functions

static QStringList layoutText (const QString &text, const QFont &fontMetrics, int maxLineWidth, int maxLines=-1, int *textHeight=0)

Private Attributes

QPixmap _helpIcon


Detailed Description

Definition at line 25 of file StatusEventItemDelegate.h.


Constructor & Destructor Documentation

StatusEventItemDelegate::StatusEventItemDelegate ( QObject *  parent = 0  ) 

Default constructor.

Definition at line 26 of file StatusEventItemDelegate.cpp.

References _helpIcon.


Member Function Documentation

QStringList StatusEventItemDelegate::layoutText ( const QString &  text,
const QFont &  fontMetrics,
int  maxLineWidth,
int  maxLines = -1,
int *  textHeight = 0 
) [static, protected]

Splits text at maxLineWidth pixels computed using the font dimensions given by fontMetrics and returns a QStringList containing at most maxLines of text. If the number of wrapped lines is greater than or equal to maxLines, the last line of text will be elided. If maxLines is less than or equal to 0, no eliding will be done. If textHeight is not NULL, it will be set to the height (in pixels) required to display the returned wrapped lines.

Definition at line 142 of file StatusEventItemDelegate.cpp.

Referenced by paint(), and sizeHint().

void StatusEventItemDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const [virtual]

Paints a status event item for index using the given paint device painter and current style options.

Definition at line 33 of file StatusEventItemDelegate.cpp.

References _helpIcon, StatusEventItem::DescriptionRole, StatusEventItem::HelpUrlRole, StatusEventItem::IconRole, layoutText(), StatusEventItem::TimestampRole, and StatusEventItem::TitleRole.

QSize StatusEventItemDelegate::sizeHint ( const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const [virtual]

Returns a QSize representing the desired dimensions needed to paint a status event item for index using the specified style options.

Definition at line 117 of file StatusEventItemDelegate.cpp.

References StatusEventItem::DescriptionRole, StatusEventItem::IconRole, layoutText(), and StatusEventItem::TimestampRole.


Member Data Documentation

Small icon image drawn in the upper-right (or upper-left in RTL layouts) for status events that have associated help URLs.

Definition at line 67 of file StatusEventItemDelegate.h.

Referenced by paint(), and StatusEventItemDelegate().


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

Generated on Mon Aug 30 19:14:04 2010 for Vidalia by  doxygen 1.5.9