1. QHash is not a data structure that can be sorted.
2. Why don't you use the weight as a key? Like this:
Qt Code:
  1. mCurrentCache[myDataObject.weight] = myData;
To copy to clipboard, switch view to plain text mode