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. Splitter between items in QTreeView
Forum Updated to NodeBB v4.3 + New Features

Splitter between items in QTreeView

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 4 Posters 1.1k 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.
  • F Offline
    F Offline
    flammmable
    wrote on last edited by
    #1

    I want to resize an items height in a QTreeView separately for each item. Is there an easy way to make splitters between each items in a QTreeView?

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      No, you have to do it on your own - maybe by subclassing QTreeView but I don't think it's that easy...

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • F Offline
        F Offline
        flammmable
        wrote on last edited by
        #3

        Thank you. It's sad.

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

          Hi,

          Can you explain your use case in more details ?
          Would resizing rows be enough ?

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

          VRoninV F 2 Replies Last reply
          1
          • SGaistS SGaist

            Hi,

            Can you explain your use case in more details ?
            Would resizing rows be enough ?

            VRoninV Offline
            VRoninV Offline
            VRonin
            wrote on last edited by
            #5

            Yeah, I think OP wants to do what QHeaderView::setResizeMode(QHeaderView::Interactive) does but on rows of a treeview

            "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
            2
            • SGaistS SGaist

              Hi,

              Can you explain your use case in more details ?
              Would resizing rows be enough ?

              F Offline
              F Offline
              flammmable
              wrote on last edited by
              #6

              @SGaist Would resizing rows be enough ?
              Yes it will de enough.
              Now I try to use a QTreeWidget and itemAt to define an item under a mouse cursor. Also I try to redefine mouseMoveEvent in a QTreeWidgetItem but still have not reach a success. Can't write a right constructors fo MyTreeWidgetItem. I will be grateful for any advice

              F 1 Reply Last reply
              0
              • F flammmable

                @SGaist Would resizing rows be enough ?
                Yes it will de enough.
                Now I try to use a QTreeWidget and itemAt to define an item under a mouse cursor. Also I try to redefine mouseMoveEvent in a QTreeWidgetItem but still have not reach a success. Can't write a right constructors fo MyTreeWidgetItem. I will be grateful for any advice

                F Offline
                F Offline
                flammmable
                wrote on last edited by
                #7

                @flammmable The QTreeWidgetItem have not a mouseMoveEvent. Hmm...

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

                  Because items have no visual representation, that's done by the delegate.

                  If you want to go that way, you have to re-implement the mouseXXXEvents of your QTreeWidget.

                  As an alternative, you might want to add a vertical QHeaderView like QTableView.

                  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
                  1

                  • Login

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