Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Can I turn sorting on or off in QSortFilterProxyModel?
Forum Updated to NodeBB v4.3 + New Features

Can I turn sorting on or off in QSortFilterProxyModel?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 438 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pada_
    wrote on last edited by
    #1

    Can I turn sorting on or off in QSortFilterProxyModel?

    I want to sort the first second column when it is clicked, and sort off when the column is pressed.

    JonBJ 1 Reply Last reply
    0
    • P Pada_

      Can I turn sorting on or off in QSortFilterProxyModel?

      I want to sort the first second column when it is clicked, and sort off when the column is pressed.

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @Pada_
      There are several possible ways to achieve this. If you have derived your own class, your can override http://doc.qt.io/qt-5/qsortfilterproxymodel.html#sort to decide to do nothing if the column is not one you want to sort on. Or, you could do the work at the view side instead of in the model if you prefer.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved