forked from openwall/johnny
-
Notifications
You must be signed in to change notification settings - Fork 5
/
tablemodel.h
37 lines (28 loc) · 907 Bytes
/
tablemodel.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
/*
* Copyright (c) 2011 Shinnok <raydenxy at gmail.com>. See LICENSE.
*/
#ifndef TABLEMODEL_H
#define TABLEMODEL_H
#include <QAbstractTableModel>
#include <QStringList>
#define TABLE_ROWS 500000
#define TABLE_COLUMNS 2
class TableModel : public QAbstractTableModel
{
Q_OBJECT
public:
TableModel(QObject *parent = 0);
~TableModel();
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
bool setData(const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole);
QVariant headerData(int section,
Qt::Orientation orientation,
int role = Qt::DisplayRole) const;
private:
QStringList m_table;
};
#endif // TABLEMODEL_H