QTreeWidget with connecting lines for the tree branches
-
wrote on 9 Mar 2017, 23:14 last edited by
Hi,
I have a quite complex QTreeWidget (tree of objects), and with the "fusion" style, the branches of the tree are not visible, which is very confusing. I noticed that if I set the QTreeWidget to "windows" style, I get what I want. Except that the style doesn't match the rest of the application anymore.Is there another way to have the branches of a QTreeWidget be visible?
Thanks for any help
-
wrote on 10 Mar 2017, 08:40 last edited by VRonin 3 Oct 2017, 08:40
have you tried with stylesheet on QTreeView::branch http://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtreeview ?
-
wrote on 10 Mar 2017, 14:37 last edited by
Hello VRonin,
that was exactly what I was looking for! Thanks a lot. Now it looks as below. Everything looks fine, except when I have one (or more) selected item and my QTreeWidget doesn't have the focus: there is a blue part that wasn't there previously. Any idea why that appeared, or how I can get rid of it? I didn't touch any color when setting the stylesheet:
-
wrote on 10 Mar 2017, 15:10 last edited by
When setting a stylesheet it removes the previous default so I'm afraid you'll need to finde the correct pseudo-state and apply the background colour manually
-
wrote on 12 Mar 2017, 19:21 last edited by
Again, thanks a lot for your help :)
1/5