Results 1 to 2 of 2

Thread: QTreeView: get current sort column and order

  1. #1
    Join Date
    Aug 2008
    Posts
    35
    Thanks
    7
    Thanked 3 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default QTreeView: get current sort column and order

    How can I get the current sort culumn and the order? I need this because I want to save the order to a file so I can automatically load the order on restart.

    Is it possible to get the culumn width too?

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTreeView: get current sort column and order

    use this method to determinate sort column
    Qt Code:
    1. int QHeaderView::sortIndicatorSection () const
    To copy to clipboard, switch view to plain text mode 
    and use this method to determinate sort order
    Qt Code:
    1. Qt::SortOrder QHeaderView::sortIndicatorOrder () const
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to spirit for this useful post:

    supergillis (14th October 2008)

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.