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. QTreeWidget with connecting lines for the tree branches

QTreeWidget with connecting lines for the tree branches

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtreewidget
5 Posts 2 Posters 6.7k 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.
  • F Offline
    F Offline
    floatingWoods
    wrote on 9 Mar 2017, 23:14 last edited by
    #1

    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

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VRonin
      wrote on 10 Mar 2017, 08:40 last edited by VRonin 3 Oct 2017, 08:40
      #2

      have you tried with stylesheet on QTreeView::branch http://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtreeview ?

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      1
      • F Offline
        F Offline
        floatingWoods
        wrote on 10 Mar 2017, 14:37 last edited by
        #3

        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:

        alt text

        1 Reply Last reply
        0
        • V Offline
          V Offline
          VRonin
          wrote on 10 Mar 2017, 15:10 last edited by
          #4

          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

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply
          3
          • F Offline
            F Offline
            floatingWoods
            wrote on 12 Mar 2017, 19:21 last edited by
            #5

            Again, thanks a lot for your help :)

            1 Reply Last reply
            0

            1/5

            9 Mar 2017, 23:14

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved