source: trunk/FACT++/gui/CheckBoxDelegate.h@ 10395

Last change on this file since 10395 was 10394, checked in by tbretz, 14 years ago
First version of the GUI.
File size: 841 bytes
Line 
1#ifndef FACT_CheckBoxDelegate
2#define FACT_CheckBoxDelegate
3
4#include <QtCore/QEvent>
5#include <QtGui/QStandardItem>
6
7using namespace std;
8
9class CheckBoxEvent : public QEvent
10{
11public:
12 const QStandardItem &item;
13
14 CheckBoxEvent(const QStandardItem &i)
15 : QEvent((QEvent::Type)QEvent::registerEventType()),
16 item(i) { }
17};
18
19
20#include <QtGui/QStyledItemDelegate>
21
22class CheckBoxDelegate : public QStyledItemDelegate
23{
24 Q_OBJECT;
25
26public:
27 CheckBoxDelegate(QObject *p=0) : QStyledItemDelegate(p)
28 {
29 }
30
31 void paint(QPainter *painter,
32 const QStyleOptionViewItem &option,
33 const QModelIndex &index) const;
34
35 bool editorEvent(QEvent *evt, QAbstractItemModel *model,
36 const QStyleOptionViewItem &option,
37 const QModelIndex &index);
38};
39
40#endif
Note: See TracBrowser for help on using the repository browser.