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

Last change on this file since 11020 was 10657, checked in by tbretz, 14 years ago
Added or improved documentation.
File size: 807 bytes
Line 
1#ifndef FACT_CheckBoxDelegate
2#define FACT_CheckBoxDelegate
3
4#include <QEvent>
5#include <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 <QStyledItemDelegate>
21
22class CheckBoxDelegate : public QStyledItemDelegate
23{
24public:
25 CheckBoxDelegate(QObject *p=0) : QStyledItemDelegate(p)
26 {
27 }
28
29 void paint(QPainter *painter,
30 const QStyleOptionViewItem &option,
31 const QModelIndex &index) const;
32
33 bool editorEvent(QEvent *evt, QAbstractItemModel *model,
34 const QStyleOptionViewItem &option,
35 const QModelIndex &index);
36};
37
38#endif
Note: See TracBrowser for help on using the repository browser.