PDA

View Full Version : Can I use something like QMap<int, QString> buwith repeated keys?



ricardo
3rd August 2009, 12:32
Hi friends?

I have several strings and each one have a integer value property (same times 2 differnte strings have the same integer value )

I read this on http://doc.trolltech.com/4.5/qmap.html
"If you want to sort your strings in an arbitrary order, consider using the QMap class. For example, you could use a QMap<QString, QString> to create a case-insensitive ordering (e.g. with the keys being lower-case versions of the strings, and the values being the strings), or a QMap<int, QString> to sort the strings by some integer index."

I'd like to order them using this value, the problem is that I can't use a map because key must be unique.

Do you have any other suggestion?

Thanks in advance.

spirit
3rd August 2009, 12:44
take a look at QMultiMap.