2 * This file Copyright (C) Mnemosyne LLC
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2
6 * as published by the Free Software Foundation.
8 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10 * $Id: tracker-delegate.h 11284 2010-10-01 20:22:51Z charles $
13 #ifndef QTR_TORRENT_DELEGATE_H
14 #define QTR_TORRENT_DELEGATE_H
16 #include <QItemDelegate>
20 class QStyleOptionViewItem
;
25 class TrackerDelegate
: public QItemDelegate
30 TrackerDelegate( QObject
* parent
=0 ): QItemDelegate(parent
), myShowMore(false) { }
31 virtual ~TrackerDelegate( ) { }
34 QSize
sizeHint(const QStyleOptionViewItem
& option
, const QModelIndex
& index
) const;
35 void paint(QPainter
* painter
, const QStyleOptionViewItem
& option
, const QModelIndex
& index
) const;
38 void setShowMore( bool b
);
41 QString
getText( const TrackerInfo
& ) const;
42 QSize
margin( const QStyle
& style
) const;
43 virtual QSize
sizeHint( const QStyleOptionViewItem
&, const TrackerInfo
& ) const;
44 void drawTracker( QPainter
*, const QStyleOptionViewItem
&, const TrackerInfo
& ) const;