aboutsummaryrefslogtreecommitdiff
path: root/paperreplaymodel.h
diff options
context:
space:
mode:
Diffstat (limited to 'paperreplaymodel.h')
-rw-r--r--paperreplaymodel.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/paperreplaymodel.h b/paperreplaymodel.h
new file mode 100644
index 0000000..4184c8c
--- /dev/null
+++ b/paperreplaymodel.h
@@ -0,0 +1,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