Feature #4380

WTableView: support for multiple column sorting

Added by Emeric Poupon over 7 years ago. Updated about 6 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:



Feature request: Multiple column sorts by clicking on Ctrl+left mouse on each column to be used for sorting.




Updated by Trigve Siver over 7 years ago

I would also like to have this feature. I could help with development, but I'm not that proficient in JS. I've implemented this feature in wxWidgets.

Also the concrete "shortcut" for multiple sorting should be custom defined (i.e. in config for instance).


Updated by Trigve Siver about 6 years ago

So I've implemented it in my branch. Attaching patch.

The left click is behaving as normal, that is it change the order if the column is sorted already. Otherwise it sort by the new column only.

Using CTRL + CLICK add new column for sorting. Clicking on the already sorted column will change it's order. CTRL + CLICK on already sorted column, will remove the column from the sorted column set. Clicking on the new column, not in already sorted columns set, will reset the sort only with this new column.

Please review.


Updated by Koen Deforche about 6 years ago

  • Status changed from New to InProgress
  • Assignee set to Roel Standaert

That sounds nice and glancing through the patch I like the approach. All it needs is support in our standard models that support sorting (WStandardItemModel, WSortFilterProxyModel).


Updated by Trigve Siver about 6 years ago

Ok, I can look at it in the near time.


Updated by Trigve Siver about 6 years ago

Here is the patch for WStandardItemModel and WSortFilterProxyModel. Because I had a problem running examples, and don't have time to look at ti, no testing has been done.

Please review and let me know if there are any bugs.

Thank you

Also available in: Atom PDF