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 problem
Qt 6.11 is out! See what's new in the release blog

QTreeView problem

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

    I have QTreeView/QFileSystemModel derived classes working pretty nicely overall. Seeking help with one cosmetic issue.

    For several reasons I want to hide the little open/close buttons on the left hand side of each QTreeView row. I am able to do this with a stylesheet:

    QTreeView::branch {image: none;}
    

    This works until I (1) select a row of the tree and (2) shift focus away from the QTreeView widget.

    In my case, a selected row with focus is dark blue. When the tree focus is lost, the color of the cells changes to mid-grey EXCEPT for the ::branch area which remains dark blue.

    I have tried a million stylesheet variations but cannot get the branch area colors to mirror those of the rest of row when selected and with/without focus.

    I tried replacing "image: none" with a reference to a 1x1 transparent pixel and get the same thing.

    I do think the behavior has changed a little going from Qt 5.5 to 5.6 too but I don't have a 5.5 available right now for direct comparison.

    It's simple enough to reproduce the problem with the Tree Model Completer Example. Just add:

    treeView->setStyleSheet("QTreeView::branch {image: none;}");
    

    I'm also wondering if you guys think this is worthy of a bug report?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      While a unusual use case (to me) I don't see a problem with opening a report about it. The worst case would be that it's closed as invalid but at least it would known.

      Please provide a minimal compilable example with your report.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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