Hi all,
I'd need to have a QHash where the elements are ordered by a certain filed inside the value.

Qt Code:
  1. struct MyData
  2. {
  3. MyData(): bitmap(0), weight(0) {}
  4. MyData(qint64 b, qint32 w) : bitmap(b), weight(w) {}
  5.  
  6. qint64 bitmap;
  7. qint32 weight;
  8. };
  9.  
  10. QHash<qint32, MyData> mCurrentCache;
To copy to clipboard, switch view to plain text mode 

In my case I would like to order the elements depending on MyData::weight.
Is there a smart way to do that or do I have to resort to an additional QHash<qint32, qint32> as a look up table?

Thanks for any help
bye