DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
schedulerjobadapter.h
Go to the documentation of this file.
1 #ifndef SCHEDULERJOBADAPTER_H
2 #define SCHEDULERJOBADAPTER_H
3 
4 #include <QObject>
5 #include <QAbstractItemModel>
6 #include <schedulerjob.h>
7 
8 class SchedulerJobAdapter : public QAbstractItemModel
9 {
10  Q_OBJECT
11 
12  SchedulerJob &mSj;
13 
14  enum Columns { JobName, ModelName, OutputName, NumSteps, UseStaticPaths,
15  ColumnsCount
16  };
17 
18 public:
19  explicit SchedulerJobAdapter(SchedulerJob &sj, QObject *parent = 0);
20 
21  void addSimulationRun(const SimulationRun &data);
22  void refresh();
23 
24  // QAbstractItemModel interface
25 public:
26  int rowCount(const QModelIndex &parent) const override;
27  int columnCount(const QModelIndex &parent) const override;
28  QVariant data(const QModelIndex &index, int role) const override;
29  bool setData(const QModelIndex &index, const QVariant &value, int role) override;
30  QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
31  Qt::ItemFlags flags(const QModelIndex &index) const override;
32 
33  QModelIndex index(int row, int column, const QModelIndex &parent) const override;
34  bool insertRows(int row, int count, const QModelIndex &parent) override;
35  bool removeRows(int row, int count, const QModelIndex &parent) override;
36  bool removeRows(std::vector<int> rows, const QModelIndex &parent);
37  QModelIndex parent(const QModelIndex &child) const override;
38 };
39 
40 #endif // SCHEDULERJOBADAPTER_H
void addSimulationRun(const SimulationRun &data)
Definition: schedulerjobadapter.cpp:12
Qt::ItemFlags flags(const QModelIndex &index) const override
Definition: schedulerjobadapter.cpp:116
SchedulerJobAdapter(SchedulerJob &sj, QObject *parent=0)
Definition: schedulerjobadapter.cpp:5
Definition: schedulerjob.h:8
Definition: schedulerjobadapter.h:8
QVariant data(const QModelIndex &index, int role) const override
Definition: schedulerjobadapter.cpp:37
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Definition: schedulerjobadapter.cpp:94
QModelIndex index(int row, int column, const QModelIndex &parent) const override
Definition: schedulerjobadapter.cpp:121
QModelIndex parent(const QModelIndex &child) const override
Definition: schedulerjobadapter.cpp:139
void refresh()
Definition: schedulerjobadapter.cpp:21
bool insertRows(int row, int count, const QModelIndex &parent) override
Definition: schedulerjobadapter.cpp:126
int columnCount(const QModelIndex &parent) const override
Definition: schedulerjobadapter.cpp:32
std::pair< box, unsigned > value
Definition: diffusion.cpp:30
bool setData(const QModelIndex &index, const QVariant &value, int role) override
Definition: schedulerjobadapter.cpp:60
bool removeRows(int row, int count, const QModelIndex &parent) override
Definition: schedulerjobadapter.cpp:145
int rowCount(const QModelIndex &parent) const override
Definition: schedulerjobadapter.cpp:27
Definition: simulationrun.h:8