[Development] QVariant comparison in Qt6

Bernhard Lindner private at bernhard-lindner.de
Fri Sep 18 22:35:23 CEST 2020

> 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.

I am using QVariant comparison (==, >, <) only for equal types. But not in models. I use
it for other code. 

I also use QMaps of QVariants, but also not for mixed types, only for equal types.

So I need ==, <, > for equal types, including custom types. 

My preferred solution for error handling wouldn't be a fall back to "return false" but a
call to qFatal (or at least qWarning).

Best Regards,
Bernhard Lindner

More information about the Development mailing list