[Development] QVariant comparison in Qt6 (URGENT)

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Mon Nov 23 09:57:45 CET 2020


Hi,

On 22/09/2020 16:17, Thiago Macieira wrote:
> And especially if there's no impact to how the user uses the API.
> 
>> 1)
>> std::optional<int> compare();
>>
>> 2)
>> enum class Ordering { Less = -1, Equal = 0, Greater = 1, Unordered = 0xff
>> };
>>   Ordering compare();
>>
>> 3)
>> Implement a Qt replacement for std::partial_ordering (could use the std
>> stuff if C++ 20 is available) and use that.
> I'd rather stay simple and allow extending for <compare> where more details
> are necessary.
> 
> For that, I think #1.
> 

I'm reopening this old thread (which I somehow missed) because 
eventually #1 was implemented. But optional<int> is the wrong API for a 
comparison result.

I've quickly implemented 3) and pushed it here. It's only missing docs.

https://codereview.qt-project.org/c/qt/qtbase/+/322900

(includes the rationale of why optional is the wrong datatype)


Still in time to target 6.0.0?

Thanks,
-- 
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/development/attachments/20201123/117482c5/attachment.bin>


More information about the Development mailing list