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

TreeView QML Type should provide a mapping between visible row and ModelIndex row

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Invalid
    • P2: Important
    • None
    • None
    • Quick: Other
    • None

    Description

      The TreeView QML Type API works on the basis of visible rows, e.g. https://doc.qt.io/qt-6/qml-qtquick-treeview.html#expandRecursively-method "row should be the row in the view (table row), and not a row in the model."

      We are working now on a TreeModel QML Type QTBUG-130571 and it will (obviously) have a model row based API or a QModelIndex based API to be exact (similar to QmlTableModel (https://doc.qt.io/qt-6/qml-qt-labs-qmlmodels-tablemodel.html).

      So at some point we (and our users) will need (or at least benefit) a mapping from visible row to QModelIndex. The right place would imho be the TreeView in the form of e.g.:

      Q_INVOKABLE QModelIndex modelIndex(int row, int column);

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              matthias_rauter Matthias Rauter
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes