aboutsummaryrefslogtreecommitdiff
path: root/paperreplaymodel.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2015-06-14 03:32:35 +0200
committerJavier <dev.git@javispedro.com>2015-06-14 03:32:35 +0200
commit46cb4b079be113996214660020d6ef0c3d1f1e80 (patch)
tree4f3c7ec2d09fe532b2d0a640aadffe52d6abf67a /paperreplaymodel.h
parent59feffc5a253fec33b310f7a0105c8ef42b9019b (diff)
downloadscribiu-46cb4b079be113996214660020d6ef0c3d1f1e80.tar.gz
scribiu-46cb4b079be113996214660020d6ef0c3d1f1e80.zip
paperless replay also working
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