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. [Solved] QStandardItemModel Multi Column Sort

[Solved] QStandardItemModel Multi Column Sort

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 997 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.
  • W Offline
    W Offline
    ws22
    wrote on last edited by
    #1

    Hello,
    How can i sort multiple columns of a QStandardItemModel ?

    origin
    1 CCC BBB
    2 AAA CCC
    3 AAA AAA

    sort to
    1 AAA AAA
    2 AAA CCC
    3 CCC BBB

    Thanks in advance !

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi,

      Do it in 2 steps: Sort by the 2nd column, and then sort by the 1st column.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • W Offline
        W Offline
        ws22
        wrote on last edited by
        #3

        hello,
        tsss, how easy.
        thanks for the quick reply !

        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