-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtablesdata.h
55 lines (44 loc) · 876 Bytes
/
tablesdata.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 TABLESDATA_H
#define TABLESDATA_H
#include <QFile>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonValue>
#include <QByteArray>
#include <QVector>
#include <QString>
struct Meeting
{
QString name;
QString id;
QString password;
};
struct Schedule
{
QString name;
QString start;
QString duration;
};
class TablesData : public QObject
{
Q_OBJECT
QFile jsonFile;
QJsonDocument doc;
public:
TablesData(QString jsonFileName, QObject *parent=nullptr);
void load();
QVector<Meeting> meetings;
QVector<QVector<Schedule>> schedule;
signals:
void dataLoaded();
public slots:
void saveData();
private:
void read();
void write();
void create();
void jsonToVectors(QJsonObject mainObj);
void vectorsToJson(QJsonObject mainObj);
};
#endif // TABLESDATA_H