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. How to style the background of a QTreeWidget?
Forum Update on Monday, May 27th 2025

How to style the background of a QTreeWidget?

Scheduled Pinned Locked Moved Solved General and Desktop
qtreewidgetqt5stylesheet
2 Posts 1 Posters 2.2k 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
    Jakob
    wrote on 8 Dec 2015, 13:49 last edited by
    #1

    I'm trying to style a QTreeWidget which I added to my form through an application-wide stylesheet. From http://doc.qt.io/qt-5/stylesheet-reference.html I was expecting that I could either do

    QTreeView {
        background-color: red;
    }
    
    /* or */
    QTreeWidget {
        background-color: red;
    }
    

    None of them work however - how can I change the background color of this widget?

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jakob
      wrote on 8 Dec 2015, 14:38 last edited by
      #2

      It turns out the style was overwritten by a style appearing at the end of the stylesheet...... bummer

      1 Reply Last reply
      1

      2/2

      8 Dec 2015, 14:38

      • Login

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