forked from GLDsuh-a/qt-1
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgsampleitemdelegate.h
37 lines (28 loc) · 1.19 KB
/
gsampleitemdelegate.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef GSAMPLEITEMDELEGATE_H
#define GSAMPLEITEMDELEGATE_H
#include <QStyledItemDelegate>
#include <QMetaType>
QT_BEGIN_NAMESPACE
class GSampleItemPrivate;
class QTableView;
QT_END_NAMESPACE
class GSampleItemDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
explicit GSampleItemDelegate(QStringList* channel, int* rox, QStringList* sample, GSampleItemPrivate* setData, QObject* parent = 0);
virtual void paint(QPainter* painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const;
virtual QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
virtual void setEditorData(QWidget* editor, const QModelIndex& index) const;
virtual void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex &index) const;
protected:
virtual bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index);
private:
GSampleItemPrivate* m_set;
QStringList* const m_channel_names;
QStringList* const m_sample_names;
QTableView* m_tableView;
int* m_rox;
};
Q_DECLARE_METATYPE(QTableView *)
#endif // GSAMPLEITEMDELEGATE_H