Help need for sorting elements in QCombobox
Hi,
I have a QStringList and i use it to set the contents of QCombobox.
I want the contents in QcomboBox as sorted so i called a sort function on QStringList before setting it to QCombobox.
But the string in the list are sorted based on case also, i dont what this to happen. how to solve this problem.
Ex: Help, Ha, he Zan.
it sorts it like Ha, Help, Zan, he but i want it as Ha, he, Help, Zan.
I want to know how to do using built in function if possible ?
Please do replay is there a way or not.
Re: Help need for sorting elements in QCombobox
Re: Help need for sorting elements in QCombobox
In documentation you can read:
Quote:
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.