[Development] QVariant comparison in Qt6

Lars Knoll lars.knoll at qt.io
Fri Sep 18 10:37:36 CEST 2020



> On 18 Sep 2020, at 10:28, Albert Astals Cid <albert.astals.cid at 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.

Cheers,
Lars

> 
> Cheers,
>  Albert
> 
>> Cheers,
>> Lars
>> 
>> 
>> Cheers,
>> Albert
>> 
>> --
>> Albert Astals Cid |
>> albert.astals.cid at kdab.com<mailto:albert.astals.cid at kdab.com> | Senior
>> Software Engineer
> Klarälvdalens Datakonsult AB, a KDAB Group company
>> Tel: Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
>> KDAB - The Qt, C++ and OpenGL Experts
>> 
>> _______________________________________________
>> Development mailing list
>> Development at qt-project.org<mailto:Development at qt-project.org>
>> https://lists.qt-project.org/listinfo/development
>> 
> 
> 
> -- 
> Albert Astals Cid | albert.astals.cid at kdab.com | Senior Software Engineer
> Klarälvdalens Datakonsult AB, a KDAB Group company
> Tel: Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
> KDAB - The Qt, C++ and OpenGL Experts
> 



More information about the Development mailing list