Regression: pitches in Edit Drumset not sorted in numeric order

• Apr 7, 2017 - 10:53
Reported version
2.2
Type
Graphical (UI)
Severity
S4 - Minor
Status
closed
Project

In #177646, I suggested more fitting column widths in the "Edit drumset“ dialogue. In the change that fixed the issue the ability to sort columns was also introduced. (60e55b2704 )

There is an issue with sorting columns, however: If one orders by "No", ordering happens like this: "0, 10, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 11" instead of "0, 1, 2, 3, 4, 5, …“ I'm sure that is not intended.

Bildschirmfoto 2017-03-30 um 22.09.22.png


Comments

The problem seems to be that there is no property in Qt that would be able to influence the sorting algorithm, other than whether to sort descending or ascending.
See http://doc.qt.io/qt-5/qt.html#SortOrder-enum

It does indeed sort in alapethical order.

One thing that might work is to add leading zeroes, so we have 3-digit numbers all the way, but that'd look rather ugly.

This also isn't really a regression, as before sorting wasn't possible at all.
We could disable the sorting entirely though

If I remember correctly adding zeros at the beginning will put all of the numbers starting with 0 after the numbers starting with 1-9, that would be worse.

I don't use this option much, but I would prefer no sort to a bad sort. i don't know what qt has as far as capabilities, but does it include a return to default or default display you could call if the user selects sort by number?

@mike320: I'm pretty sure you're remembering incorrectly, 0 is smaller than 1, numerically and alphabethically (0 is ASCII 48, 1 is 49), so with leading 0 the sorting would be correct. But look ugly.

Also apparently is it not possible to set which columns can get sorted and which down, it seems either all or none. The code sorts the last column by default, and descending, Z-A