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

QTreeview stylesheet "show-decoration-selected" has no effect

    XMLWordPrintable

Details

    • Windows
    • f4976f86cd265d7505da449dafe15c51e3c8cdc0 (qt/qtbase/5.12)

    Description

      According to Qt docs, The selection behavior of QTreeView can be controlled by the show-decoration-selected property. But setting this property in style sheet has no impact.

      It can be reproduced easily with "Simple Tree Model" example and setting stylesheet as follows:

      setStyleSheet("QTreeView { show-decoration-selected:1; }");
      

      Changing show-decoration-selected to 0 does not make any difference. Looks like value specified by the current style is not be overridden by the style sheet.
      For the styles Windows and WindowsVista the tree decoration is not be shown selected by default. And for Fusion style, Its is always shown. Cannot be changed by the stylesheet.

      Attachments

        1. class.png
          19 kB
          Shawn Rutledge
        2. collab.png
          22 kB
          Shawn Rutledge
        3. interaction.png
          50 kB
          Shawn Rutledge
        4. qt65-tree-dont-show-decoration-selected.png
          101 kB
          Shawn Rutledge
        5. qt65-tree-show-decoration-selected.png
          103 kB
          Shawn Rutledge

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              shmittal Shveta Mittal (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: