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. Header of first column overlaps the expand/collapse indicator in QTreeView

Header of first column overlaps the expand/collapse indicator in QTreeView

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 832 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.
  • J Offline
    J Offline
    JohnGa
    wrote on last edited by JohnGa
    #1

    Hello,
    I am experimenting with QTreeView. As can be seen from the screenshot below, there are two columns: Title, and Description. The "Title" column overlaps with the expand/collapse indicator of the group parent row.

    The "Title" column is editable. Even though the "Title" column header is displayed all the way to the left edge, one has to remember to move to the right and click in the appropriate cell location in order to edit the "Title". When there is text in the "Title" it serves as a cue for the click location. However when there is no text, there is no proper guidance to the user as to where to click in order make the edit field open up in the child "Title" cell.

    Is there a way to create a column for the "Expand/Collapse" indicator, and move the "Title" column to be directly above the start of the "Title" cells in the child rows?

    0_1565576131534_TreeView.PNG

    J 1 Reply Last reply
    0
    • J JohnGa

      Hello,
      I am experimenting with QTreeView. As can be seen from the screenshot below, there are two columns: Title, and Description. The "Title" column overlaps with the expand/collapse indicator of the group parent row.

      The "Title" column is editable. Even though the "Title" column header is displayed all the way to the left edge, one has to remember to move to the right and click in the appropriate cell location in order to edit the "Title". When there is text in the "Title" it serves as a cue for the click location. However when there is no text, there is no proper guidance to the user as to where to click in order make the edit field open up in the child "Title" cell.

      Is there a way to create a column for the "Expand/Collapse" indicator, and move the "Title" column to be directly above the start of the "Title" cells in the child rows?

      0_1565576131534_TreeView.PNG

      J Offline
      J Offline
      JohnGa
      wrote on last edited by
      #2

      Any tips on how to solve this would be deeply appreciated.

      Thanks

      1 Reply Last reply
      0
      • Christian EhrlicherC Online
        Christian EhrlicherC Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @johnga said in Header of first column overlaps the expand/collapse indicator in QTreeView:

        Is there a way to create a column for the "Expand/Collapse" indicator, and move the "Title" column to be directly above the start of the "Title" cells in the child rows?

        No since the collapse/expand icons belong to the first column.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        0
        • Chris KawaC Online
          Chris KawaC Online
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Well yes, actually. Just make an extra column, don't give it a label and set its header section to fixed size.
          Then your expand/collapse column would be index 0, Title would become index 1 and Description index 2

          1 Reply Last reply
          1
          • Christian EhrlicherC Online
            Christian EhrlicherC Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @chris-kawa said in Header of first column overlaps the expand/collapse indicator in QTreeView:

            set its header section to fixed size.

            But how much size? This space depends on the style and the tree depth.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            Chris KawaC 1 Reply Last reply
            1
            • Christian EhrlicherC Christian Ehrlicher

              @chris-kawa said in Header of first column overlaps the expand/collapse indicator in QTreeView:

              set its header section to fixed size.

              But how much size? This space depends on the style and the tree depth.

              Chris KawaC Online
              Chris KawaC Online
              Chris Kawa
              Lifetime Qt Champion
              wrote on last edited by Chris Kawa
              #6

              @christian-ehrlicher said in Header of first column overlaps the expand/collapse indicator in QTreeView:

              But how much size? This space depends on the style and the tree depth.

              The default indentation can be acquired by calling indentation() and the depth, by looking at the picture, is fixed. If not you can still manually set column size on expanded/collapsed signals.

              Or you could just set it to automatically adjust to contents.

              1 Reply Last reply
              1

              • Login

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