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. QTreeView selected item color when out of focus... style...
QtWS25 Last Chance

QTreeView selected item color when out of focus... style...

Scheduled Pinned Locked Moved Unsolved General and Desktop
qstylesheetqtreeviewqstandarditem
2 Posts 2 Posters 1.9k 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.
  • D Offline
    D Offline
    Dariusz
    wrote on 1 Sept 2019, 19:34 last edited by Dariusz 9 Jan 2019, 19:37
    #1

    Hey

    I'm losing my mind... which style parameter do I have to edit to control the color of item when the widget loses focus? Apparently it changes from x to y for some reason...

    Also... if I do show-decoration-selected: 1;
    How do I control decoration color ?

    TIA

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on 1 Sept 2019, 22:42 last edited by Chris Kawa 9 Jan 2019, 22:43
      #2

      which style parameter do I have to edit to control the color of item when the widget loses focus?

      QTreeView::item:active { color: red; }   /*  When widget has focus*/
      QTreeView::item:!active { color: blue; } /*  When widget doesn't have focus*/
      

      if I do show-decoration-selected: 1; How do I control decoration color ?

      It depends on the platform styling. For example on Windows it only colors on hover the little arrow that expands/collapses the branch and that arrow is painted by a system style call so you can't control its color. You can however replace the system styling and change the branch images to your own with any color you like. See Customizing QTreeView for examples.

      1 Reply Last reply
      3

      1/2

      1 Sept 2019, 19:34

      • Login

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