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. Facing plroblem to add line(image or coloured line) between each added item in QTreeWidget
Forum Updated to NodeBB v4.3 + New Features

Facing plroblem to add line(image or coloured line) between each added item in QTreeWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 5 Posters 1.1k 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.
  • Q Offline
    Q Offline
    qtsoftdevloper
    wrote on last edited by
    #1

    I am working on QTreeWidget. Please find the attached screenshots to see the issues.

    Issue 1.

    I have to add a horizontal line/image (according to red horizontal rectangle) between each added items into QTreeWidget.

    Issue 2.
    
I have to add a Vertical blue line/image (according to red vertical rectangle) in selcted items into QTreeWidget.

    0_1545236676830_Image1.png

    jsulmJ 1 Reply Last reply
    0
    • Maaz MominM Offline
      Maaz MominM Offline
      Maaz Momin
      wrote on last edited by
      #2

      You can add Delegate. Create a class that inherits QStyleItemDelegate. Override paint() function and set this delegate to your QTreeWidget.

      Q 1 Reply Last reply
      1
      • Q qtsoftdevloper

        I am working on QTreeWidget. Please find the attached screenshots to see the issues.

        Issue 1.

        I have to add a horizontal line/image (according to red horizontal rectangle) between each added items into QTreeWidget.

        Issue 2.
        
I have to add a Vertical blue line/image (according to red vertical rectangle) in selcted items into QTreeWidget.

        0_1545236676830_Image1.png

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @qtsoftdevloper To me this "Select Drive" looks rather like a QListView, not QTreeView. Are you sure it should be a QTreeView?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        Q 1 Reply Last reply
        1
        • jsulmJ jsulm

          @qtsoftdevloper To me this "Select Drive" looks rather like a QListView, not QTreeView. Are you sure it should be a QTreeView?

          Q Offline
          Q Offline
          qtsoftdevloper
          wrote on last edited by qtsoftdevloper
          #4

          @jsulm

          Thanks for reply. Actually I am working on an existing code(used QTreeWidget) and QT is new for me so I don't have idea which one is good to use(QTreeWidget or QTreeView). If I use QTreeView instead of QTreeWidget there may be some other problem.

          Is it possible to solve both issues using QTreeWidget or its mandatory to use QTreeView to solve the problem.

          1 Reply Last reply
          0
          • Maaz MominM Maaz Momin

            You can add Delegate. Create a class that inherits QStyleItemDelegate. Override paint() function and set this delegate to your QTreeWidget.

            Q Offline
            Q Offline
            qtsoftdevloper
            wrote on last edited by qtsoftdevloper
            #5

            @Maaz-Momin Thanks for reply.

            1 Reply Last reply
            0
            • H Offline
              H Offline
              herman345
              Banned
              wrote on last edited by
              #6
              This post is deleted!
              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