I suggest you ...

sort sequence of numbers in card browser

When sorting the cards in the card browser by name and the name consists of numbers, it orders them fine by increasing number, but only until 100. 101-109 is then placed after 10, 110-119 after 11, and so on.

How can I sort my cards so that the numbers are increasing steadily just like a human would count them (1,2,3,4,5 ... 100,101,102) and not mixing up eventually?

4 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Paul Jones shared this idea  ·   ·  Admin →

    2 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Jorma Spitz commented  · 

        a simple work around is to add zeros in front of the numbers. If you expect to have more than 999 cards you should write four digits for each number (0001, 0002, ..., 1004, ...)

        The sorting algorithm seems to look at numbers as if it would be normal text.

        It sorts like this:
        1
        10
        100
        2
        20
        200
        3
        30
        300

        The order with leading zeros would be:
        001
        002
        003
        010
        020
        030
        100
        200
        300

        by the way: isn't it posible to change the sorting behaviour without implementing a custom sort but using just setSortRole() as mentioned here: http://stackoverflow.com/questions/6568161/qt-sorting-is-wrong-when-using-qsortfilterproxymodel-on-number-strings-and-gett ??
        Forgive me if not, I don't know Qt for now... and thanks for this great program, I'm using it since years :-)

      Feedback and Knowledge Base