forked from openwall/johnny
-
Notifications
You must be signed in to change notification settings - Fork 5
/
filetablemodel.h
40 lines (29 loc) · 1009 Bytes
/
filetablemodel.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
38
39
40
/*
* Copyright © 2011,2012 Aleksey Cherepanov <[email protected]>. See LICENSE.
*/
#ifndef FILETABLEMODEL_H
#define FILETABLEMODEL_H
#include <QAbstractTableModel>
#include <QStringList>
#include <QVector>
#include <QString>
class FileTableModel : public QAbstractTableModel
{
Q_OBJECT
public:
FileTableModel(QObject *parent = 0);
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;
bool readFile(const QString &fileName);
private:
QVector<QVector<QString> > m_data;
QVector<QString> m_columns;
};
#endif // FILETABLEMODEL_H