Reverse iterate on QMultiMap
Unsolved
General and Desktop
-
Hello, maybe its a very treated theme, but in moment I coud not find a satisfactory answer in google.
I have the next QMultiMap List:
QMultiMap<QString, QString> data; data.insert("John", "Young"); data.insert("John", "Tall"); data.insert("Mike", "Short"); data.insert("Mike", "Good man"); data.insert("John", "Clueless"); data.insert("Mike", "Long hair"); for(const QString &name : data.uniqueKeys()){ QStringList aux = data.values(nombre); qDebug() << "Name: " << name; for(const QString &aux2 : aux) { qDebug() << aux2; } }
The code produces the next output
Name: "John" "Clueless" "Tall" "Young" Name: "Mike" "Long hair" "Good man" "Short"
The list is in The list is in random order displayed.
Is there a way to show the elements in reverse order? .... Or in a determined order, for example, alphabetical?
Thanks in avance.