Using QJson to parse this data:
"ShelveId": {
"0": {
"BeBoardId": {
"0": {
"connectionId": "board0", .... followed by more data
I'd like to traverse this table quicker than doing this. All maps are QVariantMaps:
map_BeBoardId = map_ShelveId["0"].toMap();
map_BeBoardId = map_BeBoardId["BeBoardId"].toMap();
auto temp = map_BeBoardId["0"].toMap();
m_connectionId = temp["connectionId"].toString();
qDebug() << m_connectionId;
Which works and returns me my connectionId "board0" correctly.
What I'd like to do instead is something like this:
map_BeBoardId = map_ShelveId["0"].toMap();
map_BeBoardId = map_BeBoardId["BeBoardId", "0"].toMap();
m_connectionId = map_BeBoardId["connectionId"].toString();
qDebug() << m_connectionId;
This returns me an empty connectionId.
And no, I can't use lists here as sometimes we may have a Shelve Id of "1" and "4" depending on what is connected.