2 * This file Copyright (C) 2009-2014 Mnemosyne LLC
4 * It may be used under the GNU GPL versions 2 or 3
5 * or any future license endorsed by Mnemosyne LLC.
7 * $Id: tracker-delegate.h 14241 2014-01-21 03:10:30Z jordan $
10 #ifndef QTR_TRACKER_DELEGATE_H
11 #define QTR_TRACKER_DELEGATE_H
13 #include <QItemDelegate>
17 class QStyleOptionViewItem
;
22 class TrackerDelegate
: public QItemDelegate
27 TrackerDelegate (QObject
* parent
=0): QItemDelegate(parent
), myShowMore(false) {}
28 virtual ~TrackerDelegate () {}
31 QSize
sizeHint(const QStyleOptionViewItem
& option
, const QModelIndex
& index
) const;
32 void paint(QPainter
* painter
, const QStyleOptionViewItem
& option
, const QModelIndex
& index
) const;
35 void setShowMore (bool b
);
38 QString
getText (const TrackerInfo
&) const;
39 QSize
margin (const QStyle
& style
) const;
40 virtual QSize
sizeHint (const QStyleOptionViewItem
&, const TrackerInfo
&) const;
41 void drawTracker (QPainter
*, const QStyleOptionViewItem
&, const TrackerInfo
&) const;