Hi guys,
I want to create a not ordered list organized in pairs. In order to achieve that I used a QHash as follows:
QHash<int,QString> lista;
QHash<int,QString>::const_iterator i;
lista[3] = "Three";
lista[2] = "Two";
lista[1] = "One";
i = lista.constBegin();
while(i != lista.constEnd())
{
qDebug() << i.key() << i.value();
i++;
}
But it’s writing a key ordered list:
1 “One”
2 “Two”
3 “Three”
instead of:
3 “Three”
2 “Two”
1 “One”
What am I doing wrong?
Thanks.
↧