2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@gmail.com>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
10 #ifndef BACKGROUNDDELEGATE_H
11 #define BACKGROUNDDELEGATE_H
13 #include <QAbstractItemDelegate>
15 class BackgroundDelegate
: public QAbstractItemDelegate
19 AuthorRole
= Qt::UserRole
,
23 BackgroundDelegate(QObject
*listener
,
24 float ratio
, QObject
*parent
= 0);
26 virtual void paint(QPainter
*painter
,
27 const QStyleOptionViewItem
&option
,
28 const QModelIndex
&index
) const;
29 virtual QSize
sizeHint(const QStyleOptionViewItem
&option
,
30 const QModelIndex
&index
) const;
33 static const int MARGIN
= 5;
38 #endif // BACKGROUNDDELEGATEL_H