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. QTreeWidget expand button style
Qt 6.11 is out! See what's new in the release blog

QTreeWidget expand button style

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

    Hello,
    I'm using a QTreeWidget to model a decision tree.
    It is looking like this: http://i.imgur.com/4ZbMvBg.png
    I wish it was looking like this: http://i.imgur.com/xeDugqK.png

    Is there any way to modify the stylesheet or something to make my widget as I want it to look like?
    Thanks a lot for your help!

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Check following Link :
      "Customize QTreeView":http://qt-project.org/doc/qt-4.7/stylesheet-examples.html#id-80435fe9-2622-41f4-bc12-2b683117521c

      Scroll down there to see stylesheet properties
      @QTreeView::branch:closed:has-children:has-siblings {
      border-image: none;
      image: url(branch-closed.png);
      }

      QTreeView::branch:open:has-children:!has-siblings,
      QTreeView::branch:open:has-children:has-siblings {
      border-image: none;
      image: url(branch-open.png);
      }@

      Just changes the 2 images as per your image requirements.

      157

      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