-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigLoader.h
More file actions
35 lines (29 loc) · 841 Bytes
/
ConfigLoader.h
File metadata and controls
35 lines (29 loc) · 841 Bytes
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
#ifndef CONFIGLOADER_H
#define CONFIGLOADER_H
#include "CommandItem.h"
#include <QObject>
#include <QString>
#include <QList>
#include <QFile>
#include <QJsonDocument>
#include <QJsonArray>
#include <QDebug>
#include <QJsonObject>
#include <QStandardPaths>
#include <QDir>
class ConfigLoader : public QObject
{
Q_OBJECT
public:
explicit ConfigLoader(QObject *parent = nullptr);
void loadFromFile(const QString &filePath);
void loadFromJson(const QByteArray &jsonData);
signals:
void configLoaded(const QList<CommandItem> &items, QSize wndSize);
void errorOccurred(const QString &reason);
private:
CommandItem parseCommandItem(const QJsonObject &obj);
CommandItem parseMenuItem(const QJsonObject &obj);
QIcon loadIcon(QString iconPath);
};
#endif // CONFIGLOADER_H