]> git.sur5r.net Git - minitube/blobdiff - src/playlistitemdelegate.h
Update API key
[minitube] / src / playlistitemdelegate.h
index 222ad9ac081fbb0db05d1efe7edfbc46aadeead6..1e4cebe25757a985a3582d71c719fda839758bd2 100644 (file)
@@ -21,40 +21,40 @@ $END_LICENSE */
 #ifndef PLAYLISTITEMDELEGATE_H
 #define PLAYLISTITEMDELEGATE_H
 
-#include <QtGui>
+#include <QtWidgets>
 
-class PlaylistItemDelegate : public QStyledItemDelegate {
+class PlaylistView;
 
+class PlaylistItemDelegate : public QStyledItemDelegate {
     Q_OBJECT
 
 public:
-    PlaylistItemDelegate(QObjectparent, bool downloadInfo = false);
+    PlaylistItemDelegate(QObject *parent, bool downloadInfo = false);
     ~PlaylistItemDelegate();
 
-    QSize sizeHint( const QStyleOptionViewItem&, const QModelIndex& ) const;
-    void paint( QPainter*, const QStyleOptionViewItem&, const QModelIndex& ) const;
+    QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const;
+    void
+    paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
     QRect downloadButtonRect(const QRect &line) const;
-    QRect authorRect(const QModelIndex& index) const;
+    QRect authorRect(const QModelIndex &index) const;
+
+    static const int thumbWidth;
+    static const int thumbHeight;
 
 private:
     void createPlayIcon();
-    void paintBody( QPainter*, const QStyleOptionViewItem&, const QModelIndex& ) const;
-    void paintDownloadInfo( QPainter* painter,
-                                        const QStyleOptionViewItem& option,
-                                        const QModelIndex& index ) const;
-
-    // active track painting
-    void paintActiveOverlay(QPainter *painter, const QRect &line) const;
-
-    //  Paints the video duration
+    void paintBody(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const;
+    void paintDownloadInfo(QPainter *painter,
+                           const QStyleOptionViewItem &option,
+                           const QModelIndex &index) const;
+    void paintActiveOverlay(QPainter *painter,
+                            const QStyleOptionViewItem &option,
+                            const QRect &line) const;
     void drawTime(QPainter *painter, const QString &time, const QRect &line) const;
 
-    static const int THUMB_WIDTH;
-    static const int THUMB_HEIGHT;
-    static const int PADDING;
+    static const int padding;
 
     QPixmap playIcon;
-    QFont boldFont;
     QFont smallerFont;
     QFont smallerBoldFont;
 
@@ -63,6 +63,8 @@ private:
 
     mutable QRect lastAuthorRect;
     mutable QHash<int, QRect> authorRects;
+
+    PlaylistView *listView;
 };
 
 #endif