Re: [Interest] qSort replacement

2021-07-21 Thread John Weeks
Lambdas as predicates are supported in C++11, too. > On Jul 21, 2021, at 9:22 AM, Rainer Wiesenfarth > wrote: > > On Wed, Jul 21, 2021 at 6:07 PM Joshua Grauman wrote: > [...] I can't figure out how to > use std::sort to sort a QList with a custom compare function. [...] > bool variantLessTha

Re: [Interest] qSort replacement

2021-07-21 Thread Rainer Wiesenfarth
On Wed, Jul 21, 2021 at 6:07 PM Joshua Grauman wrote: > [...] I can't figure out how to > use std::sort to sort a QList with a custom compare function. [...] > bool variantLessThan(const QVariant &v1, const QVariant &v2) > { > return v1.toString() < v2.toString(); > } > > qSort(fieldsList.beg

Re: [Interest] qSort replacement

2021-07-21 Thread Ahmad Samir
On 21/07/2021 18:05, Joshua Grauman wrote: Hi all, I see that qSort is deprecated in newer versions of Qt. I can also see that std::sort is intended to replace it. But I can't figure out how to use std::sort to sort a QList with a custom compare function. With qSort you could supply your own com

[Interest] qSort replacement

2021-07-21 Thread Joshua Grauman
Hi all, I see that qSort is deprecated in newer versions of Qt. I can also see that std::sort is intended to replace it. But I can't figure out how to use std::sort to sort a QList with a custom compare function. With qSort you could supply your own comparison function to sort however you want