On 18 Sep 2020, at 14:19, Albert Astals Cid <[email protected]<mailto:[email protected]>> wrote: [snip]
I’m not really in favour of adding an operator<() to QVariant again, as it would need to provide some decent ordering, and that would probably cause conflicts with operator=() that does somewhat loose comparisons for numeric types. But we could provide a compare() method similar to QMetaType. I don’t think we can provide total ordering here as some types stored in a QVariant do not provide comparison operators, but we could basically provide the same as QMetaType: std::optional<int> QVariant::compare(const QVariant &other); Would that be good enough? I think that would solve some (probably even most) of the pain, yes :) Here we go: https://codereview.qt-project.org/c/qt/qtbase/+/314463 Cheers, Lars
_______________________________________________ Development mailing list [email protected] https://lists.qt-project.org/listinfo/development
