PageRenderTime 21ms CodeModel.GetById 12ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/src/kandas-client/viewdelegate.h

http://kandas.googlecode.com/
C++ Header | 46 lines | 22 code | 7 blank | 17 comment | 0 complexity | ddb317eaf6ce0a3dbe447c9de219783d MD5 | raw file
 1/***************************************************************************
 2 *   Copyright 2009 Stefan Majewsky <majewsky@gmx.net>
 3 *
 4 *   This program is free software; you can redistribute it and/or
 5 *   modify it under the terms of the GNU General Public
 6 *   License as published by the Free Software Foundation; either
 7 *   version 2 of the License, or (at your option) any later version.
 8 *
 9 *   This program is distributed in the hope that it will be useful,
10 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
11 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 *   GNU General Public License for more details.
13 *
14 *   You should have received a copy of the GNU General Public License
15 *   along with this program; if not, write to the Free Software
16 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 ***************************************************************************/
18
19#ifndef KANDAS_CLIENT_VIEWDELEGATE_H
20#define KANDAS_CLIENT_VIEWDELEGATE_H
21
22#include <kwidgetitemdelegate.h>
23
24namespace Kandas
25{
26    namespace Client
27    {
28
29        class ViewDelegate : public KWidgetItemDelegate
30        {
31            Q_OBJECT
32            public:
33                ViewDelegate(QAbstractItemView *view, QObject *parent = 0);
34
35                virtual QList<QWidget *> createItemWidgets() const;
36                virtual void updateItemWidgets(const QList<QWidget *> widgets, const QStyleOptionViewItem &option, const QPersistentModelIndex &index) const;
37                virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
38                virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
39            Q_SIGNALS:
40                void actionTriggered(const QPersistentModelIndex &index, const QString &action);
41        };
42
43    }
44}
45
46#endif // KANDAS_CLIENT_VIEWDELEGATE_H