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] QTreeWidget branch increasing size
QtWS25 Last Chance

[SOLVED] QTreeWidget branch increasing size

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 4.0k 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.
  • mrjjM Offline
    mrjjM Offline
    mrjj
    Lifetime Qt Champion
    wrote on last edited by mrjj
    #1

    Hi
    the qtreewidget shows a small arrow for expand/collapse
    I can replace that
    with border-image in a stylesheet
    but how would I make it bigger?
    Seems to be same size regardless of image size used.
    Thanks

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

      Using
      ui->treeWidget->setIndentation(64);

      One can controls the branch size to some degree.

      Still looking for a stylesheet way of doing it.

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

        Although you can't set a size of the branch directly you can manipulate it indirectly like this:

        QTreeView::item { height: 100px; } /* manipulates item but influences the height of the branch too */
        QTreeView { qproperty-indentation: 100; } /* offsets an item and so also widens the branch, note no unit (px) */
        
        mrjjM 1 Reply Last reply
        3
        • Chris KawaC Chris Kawa

          Although you can't set a size of the branch directly you can manipulate it indirectly like this:

          QTreeView::item { height: 100px; } /* manipulates item but influences the height of the branch too */
          QTreeView { qproperty-indentation: 100; } /* offsets an item and so also widens the branch, note no unit (px) */
          
          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Chris-Kawa said:

          Ahh, ofcause qproperty !

          perfect.

          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