[Interest] QVariant compare operator

Thiago Macieira thiago.macieira at intel.com
Sun Apr 19 02:44:40 CEST 2020


On Saturday, 18 April 2020 12:57:55 -03 Giuseppe D'Angelo via Interest wrote:
> I guess that's the reason for dropping the comparisons in 6.0 and,
> eventually, reintroduce it in 7.0. With the hope that we've learned the
> lesson and proceed at _specifying_ the behaviour before implementing it.

Indeed, and implement the QVariant comparator on top of each underlying type's 
spaceship operator. That way, we could order elements of the same type. For 
mismatched types, QVariant can return std::partial_ordering::unordered.

We can't do that right now because we can't rely on C++20. In fact, no current 
compiler supports the spaceship operator. So that has to be Qt 7.

For now, the feature is badly implemented and yet too many people are using 
it. We can't simply remove it without giving fair warning. The warning is 
given.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products





More information about the Interest mailing list