-
Notifications
You must be signed in to change notification settings - Fork 0
/
jobmodel.h
55 lines (40 loc) · 1.19 KB
/
jobmodel.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef JOBMODEL_H
#define JOBMODEL_H
#include <QObject>
#include <QFile>
#include <QAbstractTableModel>
#include <QUrl>
#include <QJsonDocument>
#include <QJsonObject>
#include <QVariant>
class SettingsTabModel: public QAbstractTableModel{
Q_OBJECT
public:
explicit SettingsTabModel(QObject *parent = nullptr);
//SettingsTabModel(const QMap<QString,QString> list, QObject *parent = nullptr);
void load(const QVariantMap& map);
// Required by interface
int rowCount(const QModelIndex &parent) const override;
int columnCount(const QModelIndex &parent) const override;
QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
private:
std::vector<std::pair<QString,QString>> m_list;
};
class InfoModel: public QAbstractListModel{
Q_OBJECT
explicit InfoModel(QObject *parent = nullptr);
void load(const QVariant& map);
};
class JobModel : public QObject
{
Q_OBJECT
public:
explicit JobModel(QObject *parent = nullptr);
SettingsTabModel *settingsModel;
public slots:
void load(QJsonObject json);
signals:
private:
};
#endif // JOBMODEL_H