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. Using the value of an existing style sheet element as the value of another
Forum Updated to NodeBB v4.3 + New Features

Using the value of an existing style sheet element as the value of another

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

    I am attempting to set the style sheets on my QTreeView such that the selected item has the same colour regardless of whether or not the view has focus. I'm doing it using

    @QTreeView::item:selected:!active { 
        background: myColour; 
    }@
    

    Instead of passing a hard-coded value into my style sheet, I'd like to use the value of

    @QTreeView::item:selected:active@

    allowing me to always have the colour set correctly. I had a quick go at this with

    @ QTreeView::item:selected:!active {
    background: QTreeView::item:selected:active;
    }@

    just to see what happened, which was nothing. How can I extract the value of

    @QTreeView::item:selected:active@

    and use it in my style sheet?

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      I don't think this is possible.

      See http://qt-project.org/forums/viewthread/17787

      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