[Interest] efficient natural sorting

Frank Rueter | OHUfx frank at ohufx.com
Thu Nov 15 23:36:31 CET 2018


Ha, QCollator is the perfect solution, thank you!
I was not aware of that one.

Cheers,
frank

On 15/11/18 3:57 AM, Giuseppe D'Angelo via Interest wrote:
> Hi,
>
> Il 14/11/18 03:28, Frank Rueter | OHUfx ha scritto:
>> This works nicely but I’m wondering if it’s reliable and efficient to 
>> implement it like this in the QSortFilterProxyModel.lessThan() method?!
>>
>> |def lessThan(self, source_left, source_right): 
>> natural_keys(source_left) < natural_keys(source_right) |
>>
>> Any thoughts on this?
>
> You can use QCollator to implement natural sorting (by enabling the 
> numeric mode). Or doesn't it work for your use case?
>
> My 2 c,
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20181116/04048ea3/attachment.html>


More information about the Interest mailing list