#include#include QMap myMap; myMap.insert(1, "one"); myMap.insert(2, "two"); myMap.insert(3, "three");
QString value = myMap.value(2);
myMap.remove(1);This code removes the key-value pair with the key 1 from the QMap created in the first example. The `remove()` method takes the key as the argument to remove the corresponding pair. Package library: Qt Library.