[Interest] QVariant compare operator

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Mon Apr 20 11:40:24 CEST 2020


(Sorry, this was meant to go to the list!)

On 4/19/20 2:21 PM, Allan Sandfeld Jensen wrote:
>> I don't think we need "incomparable" here.
>>
>> QVariant(TypeA) and QVariant(TypeB) can be ordered for different TypeA and
>> TypeB based e.g. on alphabetical order of their .typeName().
>>
>> If wanted, this can be refined to make e.g. all integral types comparable.
>>
> What about non-integral types? QVariants can't really be anything but weakly
> ordered as I see it, as some of the things it contains are either non-
> comparable or weakly ordered themselves.


Before bikeshedding on the actual semantics we _want_ to have: if they
don't 100% match the ones we have right now, then it's a silent breakage
for end-users, which is a very bad idea.

So, if we ever want to have the relational operators in QVariant with
"better" semantics, we need an upgrade path that clearly signals the
breakage. Any proposals for that?

My 2 c,

-- 
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4329 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200420/f120d65f/attachment.bin>


More information about the Interest mailing list