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;
21 QRect authorRect(const QModelIndex& index) const;
24 void createPlayIcon();
25 void paintBody( QPainter*, const QStyleOptionViewItem&, const QModelIndex& ) const;
26 void paintDownloadInfo( QPainter* painter,
27 const QStyleOptionViewItem& option,
28 const QModelIndex& index ) const;
30 // active track painting
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;