add more spacing
[personal-kdebase.git] / workspace / plasma / wallpapers / image / backgrounddelegate.h
bloba26cb3b7530820cc4bd2ce56ff2ffea71ee8c3a6
1 /*
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.
8 */
10 #ifndef BACKGROUNDDELEGATE_H
11 #define BACKGROUNDDELEGATE_H
13 #include <QAbstractItemDelegate>
15 class BackgroundDelegate : public QAbstractItemDelegate
17 public:
18 enum {
19 AuthorRole = Qt::UserRole,
20 ScreenshotRole
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;
32 private:
33 static const int MARGIN = 5;
34 QObject *m_listener;
35 float m_ratio;
38 #endif // BACKGROUNDDELEGATEL_H