Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-141444

QML TreeView: items without children cannot be expanded

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.9.1
    • Quick: Controls 2
    • None

      When calling TreeView::expand(row) on a row that doesn't have any children, the following happens:
      1. TreeView delegate required property "expanded" is set to "true"

      2. If you call TreeView::isExpanded(row) aftwerwards, it's "false". This is because QQmlTreeModelToTableModel::expandRow(row) doesn't update the property if the item has no children.

      This behaviour is inconsistent. The preferred way would be to allow marking a row as expanded even when there are no children. In our use case, we fetch children only after the user tries to expand the parent item, so we can't differentiate between "expandable" and "non-expandable" items. The user should be able to expand even a potentially empty item and get feedback that it's empty.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            friendnick Mykola Vankovych
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes