Settings: unify duplicated code
[lxde/liblxqt.git] / lxqthtmldelegate.h
CommitLineData
3e7b0203
PL
1/* BEGIN_COMMON_COPYRIGHT_HEADER
2 * (c)LGPL2+
3 *
4 * LXQt - a lightweight, Qt based, desktop toolset
5 * http://lxqt.org
6 *
7 * Copyright: 2010-2011 Razor team
8 * Authors:
9 * Alexander Sokoloff <sokoloff.a@gmail.com>
10 * Paulo Lieuthier <paulolieuthier@gmail.com>
11 *
12 * This program or library is free software; you can redistribute it
13 * and/or modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2.1 of the License, or (at your option) any later version.
16 *
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
21 *
22 * You should have received a copy of the GNU Lesser General
23 * Public License along with this library; if not, write to the
24 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 * Boston, MA 02110-1301 USA
26 *
27 * END_COMMON_COPYRIGHT_HEADER */
28
29#ifndef LXQTHTMLDELEGATE_H
30#define LXQTHTMLDELEGATE_H
31
32#include <QStyledItemDelegate>
33#include <QPainter>
34#include "lxqtglobals.h"
35
f05ba5af 36namespace LXQt
3e7b0203
PL
37{
38
39class LXQT_API HtmlDelegate : public QStyledItemDelegate
40{
41 Q_OBJECT
42
43public:
44 explicit HtmlDelegate(const QSize iconSize, QObject* parent = 0);
45 virtual ~HtmlDelegate();
46
47 virtual void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
48
49 virtual QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
50
51private:
52 QSize mIconSize;
53};
54
55}
56
57#endif