Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QtQuick Controls TreeView section
Forum Updated to NodeBB v4.3 + New Features

QtQuick Controls TreeView section

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 226 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.
  • R Offline
    R Offline
    RandomName
    wrote on last edited by
    #1

    I am currently in the process of migrating from QTreeView Clas to QtQuick.Controls TreeView. In the original TreeView, I utilized the function void QHeaderView::moveSection(int from, int to) to move one of the columns to the first position (before the branch indicator). This column was used for row numbering and was displayed just before the branch indicator, unaffected by the tree's indentations. Now, I would like to achieve the same functionality in QtQuick.Controls TreeView. How can I do that?
    ac9e0b26-da8f-417e-9ddd-7399d6cc31ea-image.png

    In the documentation, there is a property called section but I'm unsure how to use it. It seems that it's used to section items row-wise rather than column-wise.

    Additionally, I can't utilize rowDelegate with styleData.row because it enumerates only visible rows (collapsed children are not counted).

    I am using Qt 5.12.2

    B 1 Reply Last reply
    0
    • R RandomName

      I am currently in the process of migrating from QTreeView Clas to QtQuick.Controls TreeView. In the original TreeView, I utilized the function void QHeaderView::moveSection(int from, int to) to move one of the columns to the first position (before the branch indicator). This column was used for row numbering and was displayed just before the branch indicator, unaffected by the tree's indentations. Now, I would like to achieve the same functionality in QtQuick.Controls TreeView. How can I do that?
      ac9e0b26-da8f-417e-9ddd-7399d6cc31ea-image.png

      In the documentation, there is a property called section but I'm unsure how to use it. It seems that it's used to section items row-wise rather than column-wise.

      Additionally, I can't utilize rowDelegate with styleData.row because it enumerates only visible rows (collapsed children are not counted).

      I am using Qt 5.12.2

      B Offline
      B Offline
      Bob64
      wrote on last edited by
      #2

      @RandomName I am not sure about your specific question but would just like to note, in case you aren't already aware, that the TreeView in Qt 5.12 comes from the original Quick Controls library, which is deprecated in later Qt 5 releases and has been completely removed in Qt 6.

      There is a completely new TreeView in Qt 6 which is not a drop-in replacement for the old one. If you have any plans to upgrade to Qt 6 in the near future, it might be worth bringing those plans forward rather than having to do this work twice.

      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