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. Is column sub sorting possible in QSortFilterProxyModel?

Is column sub sorting possible in QSortFilterProxyModel?

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 702 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.
  • P Offline
    P Offline
    Pada_
    wrote on last edited by
    #1

    Can one of the five QSortFilterProxyModel columns be sort and the other columns not sort?

    JonBJ 1 Reply Last reply
    0
    • P Pada_

      Can one of the five QSortFilterProxyModel columns be sort and the other columns not sort?

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

      @Pada_
      What "five columns"?
      In the normal course, QSortFilterProxyModel can sort by one chosen column, so is that not exactly what you want?

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Pada_
        wrote on last edited by
        #3

        @JonB said in Is column sub sorting possible in QSortFilterProxyModel?:

        QSortFilterProxyModel

        The number of columns is five. You are currently using QSortFilterProxyModel. I want to use the last two columns as a normal model that can not be sorted.

        JonBJ 1 Reply Last reply
        0
        • P Pada_

          @JonB said in Is column sub sorting possible in QSortFilterProxyModel?:

          QSortFilterProxyModel

          The number of columns is five. You are currently using QSortFilterProxyModel. I want to use the last two columns as a normal model that can not be sorted.

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

          @Pada_
          Sorry, I still don't really understand what you are asking.
          You can only use one column at a time to sort by in a QSortFilterProxyModel (if you want to sort by multiple columns at a time, please say so).
          If you want to disallow sorting by some of the columns, you could sub-class to implement that, e.g. override QSortFilterProxyModel::sort(int column) and do nothing for certain values of column.

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

            Just to clarify, do you want:

            Number Letter
            4 a
            2 b
            1 c
            3 d

            to be sorted like this (i.e. the second column doesn't change)

            Number Letter
            1 a
            2 b
            3 c
            4 d

            Or do you just want people to be unable to sort by Letter and only sort by Number?

            "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

            P 1 Reply Last reply
            0
            • VRoninV VRonin

              Just to clarify, do you want:

              Number Letter
              4 a
              2 b
              1 c
              3 d

              to be sorted like this (i.e. the second column doesn't change)

              Number Letter
              1 a
              2 b
              3 c
              4 d

              Or do you just want people to be unable to sort by Letter and only sort by Number?

              P Offline
              P Offline
              Pada_
              wrote on last edited by
              #6

              @VRonin

              The table below (this sort is the same as the second column does not change). How can I do that?

              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