1 #ifndef PRETTYITEMDELEGATE_H
2 #define PRETTYITEMDELEGATE_H
5 #include <QStyledItemDelegate>
10 class PrettyItemDelegate : public QStyledItemDelegate {
15 PrettyItemDelegate(QObject* parent, bool downloadInfo = false);
16 ~PrettyItemDelegate();
18 QSize sizeHint( const QStyleOptionViewItem&, const QModelIndex& ) const;
19 void paint( QPainter*, const QStyleOptionViewItem&, const QModelIndex& ) const;
20 QRect downloadButtonRect(QRect line) const;
23 void createPlayIcon();
24 void paintBody( QPainter*, const QStyleOptionViewItem&, const QModelIndex& ) const;
25 void paintDownloadInfo( QPainter* painter,
26 const QStyleOptionViewItem& option,
27 const QModelIndex& index ) const;
29 // active track painting
30 void paintSelectedOverlay( QPainter *painter, qreal x, qreal y, qreal w, qreal h ) const;
31 void paintActiveOverlay( QPainter *painter, qreal x, qreal y, qreal w, qreal h ) const;
32 void paintPlayIcon(QPainter *painter) const;
34 // 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 PADDING;
44 QFont smallerBoldFont;
47 QProgressBar *progressBar;