4 Copyright (c) 2007 by Charles Connell <charles@connells.org>
6 Kopete (c) 2007 by the Kopete developers <kopete-devel@kde.org>
8 *************************************************************************
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
15 *************************************************************************
17 #ifndef PIPESDELEGATE_H
18 #define PIPESDELEGATE_H
20 #include <QItemDelegate>
25 * Delegate that allows options for pipes to be edited in place
26 * @author Charles Connell <charles@connells.org>
29 class PipesDelegate
: public QItemDelegate
34 enum PipesColumns
{ EnabledColumn
= 0, DirectionColumn
= 1, ContentsColumn
= 2, PathColumn
= 3 };
36 enum { TotalColumns
= 4 };
39 PipesDelegate ( QObject
*parent
= 0 );
41 QWidget
*createEditor ( QWidget
*parent
, const QStyleOptionViewItem
&option
, const QModelIndex
&index
) const;
42 void setEditorData ( QWidget
*editor
, const QModelIndex
&index
) const;
43 void setModelData ( QWidget
*editor
, QAbstractItemModel
*model
, const QModelIndex
&index
) const;
44 void updateEditorGeometry ( QWidget
*editor
, const QStyleOptionViewItem
&option
, const QModelIndex
&index
) const;
45 void paint ( QPainter
*painter
, const QStyleOptionViewItem
&option
, const QModelIndex
&index
) const;