1 #ifndef PRETTYITEMDELEGATE_H
2 #define PRETTYITEMDELEGATE_H
5 #include <QStyledItemDelegate>
9 class PrettyItemDelegate : public QStyledItemDelegate {
14 PrettyItemDelegate( QObject* parent = 0 );
15 ~PrettyItemDelegate();
17 QSize sizeHint( const QStyleOptionViewItem&, const QModelIndex& ) const;
18 void paint( QPainter*, const QStyleOptionViewItem&, const QModelIndex& ) const;
21 void createPlayIcon();
22 void paintBody( QPainter*, const QStyleOptionViewItem&, const QModelIndex& ) const;
23 QPointF centerImage( const QPixmap&, const QRectF& ) const;
25 // active track painting
26 void paintActiveOverlay( QPainter *painter, qreal x, qreal y, qreal w, qreal h ) const;
27 void paintPlayIcon(QPainter *painter) const;
29 // Paints the video duration
30 void drawTime(QPainter *painter, QString time, QRectF line) const;
32 static const qreal THUMB_WIDTH;
33 static const qreal THUMB_HEIGHT;
34 static const qreal PADDING;
39 QFont smallerBoldFont;