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. QTableView::sortByColumn is obsolete
Qt 6.11 is out! See what's new in the release blog

QTableView::sortByColumn is obsolete

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.3k Views
  • 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.
  • L Offline
    L Offline
    Laurent Schall
    wrote on last edited by Laurent Schall
    #1

    The documentation @ http://doc.qt.io/qt-5/qtableview-obsolete.html indicates that the function QTableView::sortByColumn is obsolete. Does someone know the alternate advised method to reach that same functionnality?

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by VRonin
      #2

      view->model()->sort(/**/); http://doc.qt.io/qt-5/qabstractitemmodel.html#sort

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      JonBJ 1 Reply Last reply
      4
      • L Offline
        L Offline
        Laurent Schall
        wrote on last edited by
        #3

        Merci, merci... in the mean time I also found out that using a QSortFilterProxyModel is working as well.

        1 Reply Last reply
        3
        • VRoninV VRonin

          view->model()->sort(/**/); http://doc.qt.io/qt-5/qabstractitemmodel.html#sort

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @VRonin
          There is presumably a reason for the obsolescence. Why has this been deprecated?

          1 Reply Last reply
          0
          • VRoninV Offline
            VRoninV Offline
            VRonin
            wrote on last edited by
            #5

            It was marked as obsolete a long time (>10 years) ago, before the time of gerrit, even before Qt5. Difficult to dig out the exact reason but I imagine it'd because this operation acts on the model so it could be misleading to call it from the view directly

            "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
            ~Napoleon Bonaparte

            On a crusade to banish setIndexWidget() from the holy land of Qt

            1 Reply Last reply
            5

            • Login

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