Vidalia
0.2.17
|
#include <StatusEventItemDelegate.h>
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 |
Definition at line 24 of file StatusEventItemDelegate.h.
StatusEventItemDelegate::StatusEventItemDelegate | ( | QObject * | parent = 0 | ) |
Default constructor.
Definition at line 25 of file StatusEventItemDelegate.cpp.
References _helpIcon.
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 141 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 32 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 116 of file StatusEventItemDelegate.cpp.
References StatusEventItem::DescriptionRole, StatusEventItem::IconRole, layoutText(), and StatusEventItem::TimestampRole.
QPixmap StatusEventItemDelegate::_helpIcon [private] |
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 66 of file StatusEventItemDelegate.h.
Referenced by paint(), and StatusEventItemDelegate().