How to sort QList<double>. Unfortunately sort() is not a member of this class. What would be the best way to do this sort? Is this the best way:
Qt Code:
qSort(mylist.begin() , mylist.end());To copy to clipboard, switch view to plain text mode
How to sort QList<double>. Unfortunately sort() is not a member of this class. What would be the best way to do this sort? Is this the best way:
Qt Code:
qSort(mylist.begin() , mylist.end());To copy to clipboard, switch view to plain text mode
Last edited by timmu; 24th August 2012 at 13:08.
It's the only way to sort lists.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
QList is not the Qt way for std::list, i mean that it's not a linked list, read more here.
QList has random access. You can therefore use any of these, I believe.
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
so?
1234567890
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
I was just saying qSort is not 'the only' way as you suggested.
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
Bookmarks