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 Stylesheet: Changing anything for the ::branch removes the chevron icon

QTreeView Stylesheet: Changing anything for the ::branch removes the chevron icon

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 784 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.
  • qwasder85Q Offline
    qwasder85Q Offline
    qwasder85
    wrote on last edited by qwasder85
    #1

    This is not something I've encountered before. Just by doing this:

    QTreeView#myTreeView::branch:open
    {
        border-top: 2px solid #A0A0A0;
    }
    

    The little opened/closed chevron icon leading every branch disappears (which is the "image"-property). Usually changing a property in the stylesheet does not affect other properties of a widget.
    Is there a way to get this default icon back and not having to implement a custom icon now (this introduces a whole lot of new problems)?

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @qwasder85 said in QTreeView Stylesheet: Changing anything for the ::branch removes the chevron icon:

      Usually changing a property in the stylesheet does not affect other properties of a widget.

      This is not true: "Style sheets are applied on top of the current widget style, meaning that your applications will look as native as possible, but any style sheet constraints will be taken into consideration."

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      qwasder85Q 1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        @qwasder85 said in QTreeView Stylesheet: Changing anything for the ::branch removes the chevron icon:

        Usually changing a property in the stylesheet does not affect other properties of a widget.

        This is not true: "Style sheets are applied on top of the current widget style, meaning that your applications will look as native as possible, but any style sheet constraints will be taken into consideration."

        qwasder85Q Offline
        qwasder85Q Offline
        qwasder85
        wrote on last edited by
        #3

        @Christian-Ehrlicher You can change, say, the "font" and still keep all other original aspects of a widget. Just as an example.
        Or is this depending on which property is being changed?

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @qwasder85 said in QTreeView Stylesheet: Changing anything for the ::branch removes the chevron icon:

          Or is this depending on which property is being changed?

          meaning that your applications will look as native as possible

          It may use the other properties, but it must not. So it depends on what widget you're using and what properties you're changing.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          qwasder85Q 1 Reply Last reply
          1
          • Christian EhrlicherC Christian Ehrlicher

            @qwasder85 said in QTreeView Stylesheet: Changing anything for the ::branch removes the chevron icon:

            Or is this depending on which property is being changed?

            meaning that your applications will look as native as possible

            It may use the other properties, but it must not. So it depends on what widget you're using and what properties you're changing.

            qwasder85Q Offline
            qwasder85Q Offline
            qwasder85
            wrote on last edited by
            #5

            @Christian-Ehrlicher I see. It could've been so easy...

            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