{
"enclosures":
[
{
"data":
{
"enclosure_id": "0",
"vendor": "DELL ",
"enclosure_model": "MD1220 ",

"power_status":
[
"0",
"3"
],
"temp_status":
[
"1",
"1",
"0",
"1"
],
"temperatures":
[
"-20",
"-20",
"186",
"180"
],
"fan_status":
[
"1",
"0",
"1",
"1"
],

"alarm_count": "1",
"drive_ids":
[
"2",
"10",
],
"physicaldrives":
[
{
"data":
{
"dev_id": "0",
"ssd_life_left": "0",
"temperature": "28",
"usable_capacity": "286749479",

}
},
I want to access the value of "enclosure_id" inside data object which is inside enclosure how can I do that ? I am trying this code but not getting value
//parse json
//qDebug() << "enclosures:" << strReply;
QJsonDocument jsonResponse = QJsonDocument::fromJson(strReply.toUtf8());

QJsonObject jsonObj = jsonResponse.object();
QJsonValue value = jsonObj.value("enclosures");
QJsonArray array = value.toArray();
foreach (const QJsonValue & val, array)
qDebug() << val.toObject().value("enclosure_id").toInt();