1 #ifndef PLAYLISTITEMDELEGATE_H
2 #define PLAYLISTITEMDELEGATE_H
6 class PlaylistItemDelegate : public QStyledItemDelegate {
11 PlaylistItemDelegate(QObject* parent, bool downloadInfo = false);
12 ~PlaylistItemDelegate();
14 QSize sizeHint( const QStyleOptionViewItem&, const QModelIndex& ) const;
15 void paint( QPainter*, const QStyleOptionViewItem&, const QModelIndex& ) const;
16 QRect downloadButtonRect(QRect line) const;
17 QRect authorRect(const QModelIndex& index) const;
20 void createPlayIcon();
21 void paintBody( QPainter*, const QStyleOptionViewItem&, const QModelIndex& ) const;
22 void paintDownloadInfo( QPainter* painter,
23 const QStyleOptionViewItem& option,
24 const QModelIndex& index ) const;
26 // active track painting
27 void paintActiveOverlay( QPainter *painter, qreal x, qreal y, qreal w, qreal h ) const;
28 void paintPlayIcon(QPainter *painter) const;
30 // Paints the video duration
31 void drawTime(QPainter *painter, QString time, QRectF line) const;
33 static const qreal THUMB_WIDTH;
34 static const qreal THUMB_HEIGHT;
35 static const qreal PADDING;
40 QFont smallerBoldFont;
43 QProgressBar *progressBar;