aboutsummaryrefslogtreecommitdiff
path: root/paperreplaymodel.h
blob: 4184c8c5428a1fc32b14506101290fab46cdce01 (plain)
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
#ifndef PAPERREPLAYMODEL_H
#define PAPERREPLAYMODEL_H

#include <QtCore/QAbstractTableModel>
#include "paperreplay.h"

class PaperReplayModel : public QAbstractTableModel
{
	Q_OBJECT
public:
	explicit PaperReplayModel(PaperReplay *replay, QObject *parent = 0);

	QVariant data(const QModelIndex &index, int role) const;
	QVariant headerData(int section, Qt::Orientation orientation, int role) const;
	int rowCount(const QModelIndex &parent) const;
	int columnCount(const QModelIndex &parent) const;

	QString sessionFilename(const QModelIndex &index) const;

signals:

public slots:
	void refresh();

private:
	static QString getSessionName(const PaperReplay::Session &session);
	static QString getSessionDate(const PaperReplay::Session &session);
	static QString getSessionLength(const PaperReplay::Session &session);

private:
	PaperReplay *_replay;
	QList<PaperReplay::Session> _sessions;
};

#endif // PAPERREPLAYMODEL_H