Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-91864

Ability to change QTreeView Icon colors

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • None
    • Widgets: Style Sheets
    • None

    Description

      It would be nice to have the ability to change the tree view icon color using stylesheets.
      The regular arrow icons apart from the hover icon are too dark for darker backgrounds:

      I couldn't find any way to change the color except by replacing the icons like this:

      QTreeView::branch:has-children:!has-siblings:closed,
      QTreeView::branch:closed:has-children:has-siblings {
          border-image: none;
          image: url(":/list_arrow_white.png");
      }
      
      QTreeView::branch:open:has-children:!has-siblings,
      QTreeView::branch:open:has-children:has-siblings  {
          border-image: none;
          image: url(":/list_arrow_down_white.png");
      }
      
      QTreeView::branch:has-children:!has-siblings:closed:hover,
      QTreeView::branch:closed:has-children:has-siblings:hover {
          border-image: none;
          image: url(":/list_arrow_green.png");
      }
      
      QTreeView::branch:open:has-children:!has-siblings:hover,
      QTreeView::branch:open:has-children:has-siblings:hover  {
          border-image: none;
          image: url(":/list_arrow_down_green.png");
      }
      

      This means that whenever a user wants to create a new stylesheet and share it with the community, they need to create and check in their own icons, which may bloat the project over time (relatively speaking, the icons are tiny).

      To give a little context: our project has an option to change style sheets at runtime and we already provide a couple of options.

      Maybe there already is a simple way to change the color in the qss and I just haven't found it yet.

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            megamouse Patrick Waldner
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes