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. how to click the Header to sort by this column , on QTreeWidget?
Forum Updated to NodeBB v4.3 + New Features

how to click the Header to sort by this column , on QTreeWidget?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 5.8k 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.
  • O Offline
    O Offline
    opengpu2
    wrote on last edited by
    #1

    how to click the Header to sort by this column , on QTreeWidget?

    1. i find that the click on the Header , no reaction.
    2. i want to show an up/down arrow on 1 column of the header. how?
    3. is there existed method to sort the QTreeWidget by 1 column?
    1 Reply Last reply
    0
    • K Offline
      K Offline
      KeithS
      wrote on last edited by
      #2

      use setSortingEnabled() on the QTreeView (or QTreeWidget, which is a derived class of QTreeView)

      1 Reply Last reply
      0
      • O Offline
        O Offline
        opengpu2
        wrote on last edited by
        #3

        is there any existed sort method i can use ?

        1 Reply Last reply
        0
        • O Offline
          O Offline
          opengpu2
          wrote on last edited by
          #4

          when i setSortingEnabled(true), i can click the header, and it will sort ascending or descengding, but it's just sort by the name, and do not care anything else.
          how can i sort by myself when i click the header?
          i want to sort by the name on basis of the item type(eg, dir, and files).
          thank you

          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