Contrary to this link, how to list the value of y and value:
Qt JsonObjects and initializer lists -- deeper than one level?
QJsonObject o
{
{"x", QJsonObject { {"value", 1} }},
{"y", QJsonObject { {"value", 2} }}
};
The way below doesn't work:
int number = obj.value("y", "value");
I hope to receive the amount below:
number = 2
Thank you @JimmyG, this way it worked, I don't know if it's a correct way, I got it by trial and error.
qDebug() << o.value("y").toObject().value("value").toInt();
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments