Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    General and Desktop
    qstylesheet qtreeview qstandarditem
    2
    2
    986
    Loading More Posts
    • 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
      Dariusz last edited by Dariusz

      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 Reply Quote 0
      • Chris Kawa
        Chris Kawa Moderators last edited by Chris Kawa

        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 Reply Quote 3
        • First post
          Last post