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. Branch in QTreeView

Branch in QTreeView

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 4.5k 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
    Onyborak
    wrote on last edited by
    #1

    Hello! I have problem with QTreeView.
    How can I reduce default range between the branch and the first column?
    I tried to do this through the stylesheet - it was unsuccessful.

    raven-worxR 1 Reply Last reply
    0
    • O Onyborak

      Hello! I have problem with QTreeView.
      How can I reduce default range between the branch and the first column?
      I tried to do this through the stylesheet - it was unsuccessful.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Onyborak said in Branch in QTreeView:

      I tried to do this through the stylesheet - it was unsuccessful.

      avoid posting too much information!

      See this.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

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

        @raven-worx said in Branch in QTreeView:

        avoid posting too much information!
        See this.

        Before asking a question, I studied this example. There is nothing about this range or size of the branch.
        I tried this:

        QTreeView::item {
             width: 0px;
             margin: 0;
        }
        
        
        QTreeView::branch {
             width: 0px;
             max-width: 0px; 
             margin: 0;
        }
        
        raven-worxR 1 Reply Last reply
        0
        • O Onyborak

          @raven-worx said in Branch in QTreeView:

          avoid posting too much information!
          See this.

          Before asking a question, I studied this example. There is nothing about this range or size of the branch.
          I tried this:

          QTreeView::item {
               width: 0px;
               margin: 0;
          }
          
          
          QTreeView::branch {
               width: 0px;
               max-width: 0px; 
               margin: 0;
          }
          
          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @Onyborak
          did you see QTreeView::setIntendation() and/or QTreeView::setRootIsDecorated()

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • O Offline
            O Offline
            Onyborak
            wrote on last edited by
            #5

            @raven-worx
            yes.
            QTreeView::setIntendation() - If I set the value of the indentation field to 0, then the tree will not be visible and the child items will be displayed without a shift. But the first column will still be drawn with an indent from the left frame of the widget.

            QTreeView::setRootIsDecorated() - hide the arrows, but the first column will still be drawn with an indent from the left frame of the widget.

            raven-worxR 1 Reply Last reply
            0
            • O Onyborak

              @raven-worx
              yes.
              QTreeView::setIntendation() - If I set the value of the indentation field to 0, then the tree will not be visible and the child items will be displayed without a shift. But the first column will still be drawn with an indent from the left frame of the widget.

              QTreeView::setRootIsDecorated() - hide the arrows, but the first column will still be drawn with an indent from the left frame of the widget.

              raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              @Onyborak
              i think i still dont understand what you want to achieve.
              Do you want to display a tree-model as a table/list?

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              O 1 Reply Last reply
              0
              • raven-worxR raven-worx

                @Onyborak
                i think i still dont understand what you want to achieve.
                Do you want to display a tree-model as a table/list?

                O Offline
                O Offline
                Onyborak
                wrote on last edited by
                #7

                Found the cause of the problem. The user roles for my model started with the Qt::DisplayRole. Therefore, I redefined Qt::StatusTipRole with my role, because of this the place for status was allocated.

                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