Revert "transmission: update from 2.13 to 2.22"
[tomato.git] / release / src / router / transmission / qt / tracker-delegate.h
blob2d1fdacc347ca25a4b966ac4907c5b4751e7e9f3
1 /*
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>
17 #include <QSize>
19 class QPainter;
20 class QStyleOptionViewItem;
21 class QStyle;
22 class Session;
23 class TrackerInfo;
25 class TrackerDelegate: public QItemDelegate
27 Q_OBJECT
29 public:
30 TrackerDelegate( QObject * parent=0 ): QItemDelegate(parent), myShowMore(false) { }
31 virtual ~TrackerDelegate( ) { }
33 public:
34 QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
35 void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
37 public:
38 void setShowMore( bool b );
40 protected:
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;
46 private:
47 bool myShowMore;
50 #endif