[Development] QVariant comparison in Qt6
thiago.macieira at intel.com
Fri Sep 18 02:54:53 CEST 2020
On Thursday, 17 September 2020 16:15:47 PDT Bernhard Lindner wrote:
> There was a discussion about the decision to deprecate (remove?) QVariant
> comparison (<,>) in Qt6 completely.
> Has anything changed for Qt6 (especially regarding comparison of equal
> and/or convertible types)? Is the complete deprecation still the latest
Yes, it's changed; no, it's not deprecation.
What's been removed is the conversion. Aside from the numeric types, comparing
two variants of different types will always result in false. If you want to
compare across types, convert one to the other's type or to a common third
type. You know what data you put in there and you should know what conversions
can be lossy or not.
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel DPG Cloud Engineering
More information about the Development