Описание тега qmap
QMap is a Qt container class that implements a map a.k.a. a skip-list-based dictionary.
This container looks like this:
QMap< Key, T >
It stores key-value
pairs, and provides access to the value by the key and vice-versa. It also provides iterator-based access. A typical usage of the QMap
is as follows:
//constructs a map with strings as keys and integers as values.
QMap< QString, int > myMap;
//this will set the value for the key "qwerty" if it doesn't exist, or override the current value if it does exist:
myMap["qwerty"] = 15;
//accessing elements is as easy as this:
int i = myMap["qwerty"];
The official QMap
documentation can be found here for Qt 4.8 and here for Qt 5.