I have this Json file:
{
"place": {
"id": "99"
},
"camera": {
"id": "99",
"url": "http://192.168.0.250/stuff.php?",
}
}
What i get is all the content printed in one line with character \n printed after each field and not as it is in the file. This happens on my Ubuntu machine, but not in another machine with Debian. I'd like the file content printed line by line.. any hints? I use this code to print the content of a Json file:
QString val;
QFile file;
file.setFileName("../config.json");
file.open(QIODevice::ReadOnly | QIODevice::Text);
val = file.readAll();
file.close();
qWarning() << val;
EDIT
Tried both solution provided by user TheDarkKnight with no luck, I also tried with cat
command in terminal and the file is printed correctly, so I suspect is not a matter of OS, but Qt is involved..