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 Item row
Forum Updated to NodeBB v4.3 + New Features

QTreeView Item row

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 410 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
    Qt.Jo.Ha
    wrote on last edited by
    #1

    Hi guys
    f2ab9279-59df-4a7e-94d6-62ccefe7a8fb-image.png

    I want to get rid of that blank in treeview, is it possible?

    jsulmJ B 2 Replies Last reply
    0
    • Q Qt.Jo.Ha

      Hi guys
      f2ab9279-59df-4a7e-94d6-62ccefe7a8fb-image.png

      I want to get rid of that blank in treeview, is it possible?

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

      @Qt-Jo-Ha https://doc.qt.io/qt-5/qtreeview.html#indentation-prop

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

      Q 1 Reply Last reply
      4
      • Q Qt.Jo.Ha

        Hi guys
        f2ab9279-59df-4a7e-94d6-62ccefe7a8fb-image.png

        I want to get rid of that blank in treeview, is it possible?

        B Offline
        B Offline
        Bonnie
        wrote on last edited by
        #3

        @Qt-Jo-Ha
        Do you have experience in custom item delegates?

        Q 1 Reply Last reply
        1
        • B Bonnie

          @Qt-Jo-Ha
          Do you have experience in custom item delegates?

          Q Offline
          Q Offline
          Qt.Jo.Ha
          wrote on last edited by
          #4

          @Bonnie

          Yes. I have a delegate I made

          B 1 Reply Last reply
          0
          • jsulmJ jsulm

            @Qt-Jo-Ha https://doc.qt.io/qt-5/qtreeview.html#indentation-prop

            Q Offline
            Q Offline
            Qt.Jo.Ha
            wrote on last edited by Qt.Jo.Ha
            #5

            @jsulm

            Thank you. It works fine when I use the attribute value you gave me. But is this possible?

            7fd7b464-a02c-4206-90eb-9ce4c58469d9-image.png

            1 Reply Last reply
            0
            • Q Qt.Jo.Ha

              @Bonnie

              Yes. I have a delegate I made

              B Offline
              B Offline
              Bonnie
              wrote on last edited by
              #6

              @Qt-Jo-Ha
              Then you can use delegate to do something like

              if(index.parent().isValid())
                 opt.rect.setLeft(0);
              

              in the reimplemented paint function.

              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