Hi all,
I'd need to have a QHash where the elements are ordered by a certain filed inside the value.
struct MyData
{
MyData(): bitmap(0), weight(0) {}
MyData(qint64 b, qint32 w) : bitmap(b), weight(w) {}
qint64 bitmap;
qint32 weight;
};
QHash<qint32, MyData> mCurrentCache;
struct MyData
{
MyData(): bitmap(0), weight(0) {}
MyData(qint64 b, qint32 w) : bitmap(b), weight(w) {}
qint64 bitmap;
qint32 weight;
};
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
Bookmarks