Closed fabiaserra closed 4 months ago
@iLLiCiTiT isn't it much easier to just turn the sort role data here to e.g.:
item.setData((action_item.order, action_item.identifier), ACTION_SORT_ROLE)
So that it sorts on the tuple of order, then identifier? Of course you can replace identifier there with e.g. nice display name if you prefer that.
The current fix seems a bit overkill and admittedly hard to grasp as well.
isn't it much easier to just turn the sort role data here to e.g.:
My experience with using python objects (tuple of 2 values) in role data of model are not very good, they usually fall apart when Qt wrapper of a DCC (or on different platform) tries to convert it to QVariant
resulting in invalid value. It also does not handle TypeError
to 100% avoid TypeError we should validate or autofix order and label in backend (can be done).
works as expected, thank you @iLLiCiTiT !
Changelog Description
Sort action items by identifier so their order doesn't keep changing on every launch.
Testing notes: