-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
54 lines (48 loc) · 1.98 KB
/
main.cpp
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
#include "welcomepage.h"
#include <QApplication>
#include <QFile>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonValue>
#include <QDebug>
int main(int argc, char *argv[])
{
// QString val;
// QFile file;
// file.setFileName("test.json");
// file.open(QIODevice::ReadOnly | QIODevice::Text);
// val = file.readAll();
// file.close();
// qWarning() << val;
// QJsonDocument d = QJsonDocument::fromJson("{ "\
// "\"appDesc\": {" \
// "\"description\": \"SomeDescription\"," \
// "\"message\": \"SomeMessage\"" \
// "}," \
// "\"appName\": {" \
// "\"description\": \"Home\"," \
// "\"message\": \"Welcome\"," \
// "\"imp\":[\"awesome\",\"best\",\"good\"]"\
// "}"\
// "}");
// QJsonObject sett2 = d.object();
// qWarning() << sett2;
// QJsonValue value = sett2.value(QString("appName"));
// qWarning() << value;
// QJsonObject item = value.toObject();
// qWarning() << "QJsonObject of description: " << item;
// /* incase of string value get value and convert into string*/
// qWarning() << "QJsonObject[appName] of description: " << item["description"];
// QJsonValue subobj = item["description"];
// qWarning() << subobj.toString();
// /* incase of array get array and convert into string*/
// qWarning() << "QJsonObject[appName] of value: " << item["imp"];
// QJsonArray test = item["imp"].toArray();
// qWarning() << test[1].toString();
QApplication a(argc, argv);
WelcomePage w;
w.show();
w.setFixedSize(w.size());
return a.exec();
}