[Development] QVariant comparison in Qt6

Allan Sandfeld Jensen kde at carewolf.com
Fri Sep 18 11:13:07 CEST 2020


On Freitag, 18. September 2020 10:28:06 CEST Albert Astals Cid via Development 
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
> 
But it wasn't reliable or compliant(*), so it wasn't suitable for sorting and 
especially not to be used as a key in a QMap.

*) A < B did not guarantee B > A, even A == B, didn't imply B == A




More information about the Development mailing list