Qt QJsonObjects - list deeper than one level?

Felipebros

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

Felipebros

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.

edited at
0

Comments

0 comments
Login to comment

Related

Using Laravel whenLoaded() deeper than one level

CSS list combining counters increase level and counter with letters in a deeper level

Creating a List - Creating one more level of list than wanted

How to merge two QJsonObjects in Qt?

How to "forward" dns ip addresses one level deeper?

VS Code - Open the Project Explorer one level deeper to show classes

How can I go one level deeper in http json?

htaccess: redirect article one level deeper without loop

Why was nested list nested a level deeper with just a comma at the end of the line

need an easier way to initialize nested hashes in ruby rather than assignment at each deeper level

How to use in Angular inside an arrow function an object property (deeper than 1st level) sent by input?

List one level "unpacking"

Restructure an array of objects to a deeper level

Ruby understanding threads on a deeper level

Merge two objects inside an array, one with a key nested deeper than the other in the same document in Mongo DB

Merging with more than one level overlap not allowed

Unable to import more than one level of module

R : Convert nested list into a one level list

Query string not redirected on deeper level directories

Scrapy - can not list deeper links

How to find elements that are not deeper than a selector?

shift names of list up one level

Tree command list one level all files

Adding one more level of list using LINQ

Flattening only one level of a list in Prolog

Custom command - one less than current brightness level

How can I .Include down more than one level in LINQ?

How to test React Native components more than one level deep?

Issue with MenuItem style when having more than one level