Add to QMultiMap
#include <QMap>
#include <QDebug>
int main()
{
QMultiMap<QString, int> trunks;
trunks.insert("A", 100);
trunks.insert("B", 50);
trunks.insert("C", 50);
trunks.insert("D", 20);
trunks.insert("E", 70);
trunks.insert("F", 40);
QList<int> beeches = trunk.values("B");
qDebug() << beeches; // output: 40, 20, 100
return 0;
}
Related examples in the same category