forked from hundlab/LongQt-model
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settingsIO.h
30 lines (25 loc) · 927 Bytes
/
settingsIO.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
#ifndef SETTINGSIO_H
#define SETTINGSIO_H
#include <QObject>
#include "protocol.h"
class SettingsIO : public QObject {
Q_OBJECT
public:
static SettingsIO* getInstance();
void writedvars(shared_ptr<Protocol> proto, QXmlStreamWriter& xml); //write varmap keys to a file
void readdvars(shared_ptr<Protocol> proto, QXmlStreamReader& xml);
shared_ptr<Protocol> lastProto;
bool allowProtoChange = true;
private:
bool readProtoType(shared_ptr<Protocol>& proto, QXmlStreamReader& xml);
static SettingsIO* __instance;
SettingsIO() = default;
public slots:
void readSettings(shared_ptr<Protocol> proto, QString filename);
void writeSettings(shared_ptr<Protocol> proto, QString filename);
signals:
void ProtocolChanged(shared_ptr<Protocol>);
void CellChanged(shared_ptr<Cell>);
void settingsRead();
};
#endif