1 #ifndef PRETTYITEMDELEGATE_H
2 #define PRETTYITEMDELEGATE_H
5 #include <QStyledItemDelegate>
12 class PrettyItemDelegate : public QStyledItemDelegate {
17 PrettyItemDelegate( QObject* parent = 0 );
18 ~PrettyItemDelegate();
20 QSize sizeHint( const QStyleOptionViewItem&, const QModelIndex& ) const;
21 void paint( QPainter*, const QStyleOptionViewItem&, const QModelIndex& ) const;
24 void paintBody( QPainter*, const QStyleOptionViewItem&, const QModelIndex& ) const;
26 QPointF centerImage( const QPixmap&, const QRectF& ) const;
29 * Paints a marker indicating the track is active
31 void paintActiveOverlay( QPainter *painter, qreal x, qreal y, qreal w, qreal h ) const;
33 * Paints the video duration
35 void drawTime(QPainter *painter, QString time, QRectF line) const;
37 static const qreal THUMB_WIDTH;
38 static const qreal THUMB_HEIGHT;
39 static const qreal MARGIN;
40 static const qreal MARGINH;
41 static const qreal MARGINBODY;
42 static const qreal PADDING;