CycloBranch
cViewButtonDelegate.h
Go to the documentation of this file.
1
7#ifndef _CVIEWBUTTONDELEGATE_H
8#define _CVIEWBUTTONDELEGATE_H
9
10#include <QString>
11#include <QLocale>
12#include <QVariant>
13#include <QStyledItemDelegate>
14#include <QPainter>
15#include <QModelIndex>
16#include <QEvent>
17#include <QAbstractItemModel>
18
19
23class cViewButtonDelegate : public QStyledItemDelegate {
24
25 Q_OBJECT
26
27public:
28
29
34 cViewButtonDelegate(QObject* parent = (QObject *)0);
35
36
43 QString displayText(const QVariant& value, const QLocale& locale) const;
44
45
52 void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
53
54
55protected:
56
57
65 bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index);
66
67};
68
69
70#endif
71
A delegate to create a reference view button.
Definition: cViewButtonDelegate.h:23
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index)
Reimplementation of editorEvent.
Definition: cViewButtonDelegate.cpp:38
cViewButtonDelegate(QObject *parent=(QObject *) 0)
The constructor.
Definition: cViewButtonDelegate.cpp:10
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Reimplementation of paint.
Definition: cViewButtonDelegate.cpp:19
QString displayText(const QVariant &value, const QLocale &locale) const
Reimplementation of displayText.
Definition: cViewButtonDelegate.cpp:14