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@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to