How to read and insert key and Value in the 3D QMap
I am new Map in QT and have a 3D map like this
Code:
QMap<const char*, const char*> submap;
QMap<int, submap> map3D;
Now i inserted valued in it like this, the max of value of int is 5 but for each int value there is 50 key and value for submap.
Quote:
1) How can i insert value in map3D. I am doing like this
Code:
submapD.insert(TempA,TempB);
map3D.insert(count,submap);
count value will be incremented after TempA and TempB values will be more than 50 values.
Quote:
Can anyone tell how i can read it back from map3D?
Thanks
Re: How to read and insert key and Value in the 3D QMap
If you mean access by key, just chain two calls of QMap::value()
Code:
const char *value = map3D.value(someInt).value(someCharStar);
Btw, since you use a low level type (const char*) make sure the pointers stay valid during the life time of the map
Cheers,
_