Why is qhash not in insertion order?
Solved
General and Desktop
-
Hi
Its pr design. For speed. ( insert can be faster )
If you need it ordered, use QMap. -
@canid
Why should it be? Normal hashing algorithms won't help you at all with insertion order (the order you insert keys into it).(BTW, you're not talking about hash key clashes are you?? Or multi-values with same key?)
@mrjj
I don't see thatQMap
would have anything to do with insertion order. (Unless you mean if the input data is ordered in the first place, but the question doesn't imply that.) -
@canid
ah. yes sorry. my bad.
Read too hasty.
Map type containers rarely keep insertion order unless made to do so.
https://github.com/Tessil/ordered-map