Results 1 to 4 of 4

Thread: Sort columns using "standard" order, not ASCIIbetical order

  1. #1
    Join Date
    Nov 2007
    Posts
    36
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Sort columns using "standard" order, not ASCIIbetical order

    My column has the values "A", "a", "B", "b", "C" y "c".

    Using sortByColumn, the result is "A, B, C, a, b, c" (ASCIIbetical order) instead of "a, A, b, B, c, C" ("standard" order or usual order)

    Could you help me to solve the problem?

    I need a simple solution. Any Qt solution based on its own classes?

    Thanks.

  2. #2
    Join Date
    Dec 2010
    Posts
    11
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Sort columns using "standard" order, not ASCIIbetical order

    Are you using the Model/View classes? You could try using the QSortFilterProxyModel and see if this sorts the way you want it to. Otherwise you could have to implement your own QAbstractProxyModel.

  3. #3
    Join Date
    Nov 2007
    Posts
    36
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Sort columns using "standard" order, not ASCIIbetical order

    Quote Originally Posted by Kampfgnom View Post
    Are you using the Model/View classes? You could try using the QSortFilterProxyModel and see if this sorts the way you want it to. Otherwise you could have to implement your own QAbstractProxyModel.
    Do you know any site where I can see an example?

    Thanks.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Sort columns using "standard" order, not ASCIIbetical order

    Reimplement QAbstractItemModel::sort() or QSortFilterProxyModel::lessThan() and implement comparison operator that fits your needs.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 0
    Last Post: 27th November 2011, 12:15
  2. QToolBar allowedAreas "paint" order
    By Lykurg in forum Qt Programming
    Replies: 1
    Last Post: 30th September 2011, 04:35
  3. qsqltablemodel "order by" clause in setfilter?
    By jtdavidson in forum Newbie
    Replies: 5
    Last Post: 10th August 2010, 02:58
  4. How to sort columns by "icon"?
    By youkai in forum Qt Programming
    Replies: 3
    Last Post: 31st July 2008, 17:25
  5. how to change the "tab order"?
    By oscar721 in forum Qt Programming
    Replies: 2
    Last Post: 21st July 2008, 12:31

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.