#includeint main() { QMap map; map.insert("one", 1); map.insert("two", 2); map.insert("three", 3); return 0; }
#includeThis example is similar to the previous one, but it uses QString for both the key and the value type. It creates a QMap object and inserts three key-value pairs into it. The QMap class is part of the Qt Core library, which is a collection of classes and functions used in many Qt applications.int main() { QMap map; map.insert("key1", "value1"); map.insert("key2", "value2"); map.insert("key3", "value3"); return 0; }