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. Fix items at the top of QTreeWidget
Qt 6.11 is out! See what's new in the release blog

Fix items at the top of QTreeWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 423 Views 2 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.
  • C Offline
    C Offline
    clementNg
    wrote on last edited by
    #1

    How can I set some fix items at the top of QTreeWidget?
    When I scroll the treeWidget, those items would always be at the top.
    For example, I have 5 items. First two items would be fixed at the top and the other three items would follow the scroll action.
    How can I do that? Thank you very much.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Bonnie
      wrote on last edited by Bonnie
      #2

      Hmmm....I don't think that's possible...

      1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        You can likely take inspiration from the Frozen Column example.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        2
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi
          Its not directly supported so the trick is to use 2 tree widgets as the
          sample @SGaist links to.
          Its not perfect but workable.

          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