18.09.2020, 11:40, "Lars Knoll" <lars.kn...@qt.io>: >> On 18 Sep 2020, at 10:28, Albert Astals Cid <albert.astals....@kdab.com> >> wrote: >> >> El divendres, 18 de setembre de 2020, a les 10:22:16 CEST, Lars Knoll va >> escriure: >>> Sorting and equality are two different things. QVariant has never supported >>> a lessThan operator. >> >> Yes, it has >> >> >> https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/kernel/qvariant.h?h=5.15#n467 > > You’re right. I thought it didn’t support that. > > What is it you need? Just some total ordering of variants? The method you > mentioned in QAbstractItemModel also only does ordering for some types, > otherwise falling back to strings.
In Qt4 times comparison operators for QVariant were missing and from my experience main limitation was that it wasn't possible to have QVariant as a key in QMap without defining one manually. -- Regards, Konstantin _______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development