Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTreeWidget Branch Arrow Disappears
Qt 6.12 LTS is out! See what's new in the release blog

QTreeWidget Branch Arrow Disappears

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 921 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.
  • S Offline
    S Offline
    shathcock
    wrote on last edited by
    #1

    I have a QTreeWidget that is working well but I have a small problem. I needed to make some of the items different colors which is working fine however they are very hard to read against the default white background. I changed the background color of the entire widget to black and everything looks good but realizing that the branch column was trying to display a black > against a black background wouldn't work I changed it to yellow. Now can't see the > at all only the yellow background. Any help or suggestions would be greatly appreciated.

    S 1 Reply Last reply
    0
    • S shathcock

      I have a QTreeWidget that is working well but I have a small problem. I needed to make some of the items different colors which is working fine however they are very hard to read against the default white background. I changed the background color of the entire widget to black and everything looks good but realizing that the branch column was trying to display a black > against a black background wouldn't work I changed it to yellow. Now can't see the > at all only the yellow background. Any help or suggestions would be greatly appreciated.

      S Offline
      S Offline
      shathcock
      wrote on last edited by
      #2

      @shathcock Ok I just figured this one out. I found some arrow .png files online and copied them into the build directory and included them in the css declaration and it works....

      Here is the code in case anyone else is looking at this.

      ui->treeWidgetProcs->setStyleSheet("QTreeView { background: black; color: white; }
      QTreeView::branch { background: yellow; }
      QTreeView::branch:has-children:!has-siblings:closed,
      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); }");

      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
      • Unsolved