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

ItemSelectionModel: clarify how this model can be used from QML

    XMLWordPrintable

Details

    Description

      The items views in QML (TableView, TreeView) handles selection through ItemSelectionModel (QItemSelectionModel). This API works fine when the application is only interested in querying the selection model about the current selection. But if you need to manipulate the selection, the API is more "read-only". The current solution is to go through the QItemSelectionModel API in C++ instead, but documentation like https://doc.qt.io/qt-6/qml-qtqml-models-itemselectionmodel.html doesn't say anything about that.

      We should improve the documentation in (at least) the mentioned file to e.g show an example of how you can create and manipulate a selection from QML/C++.

      Attachments

        Issue Links

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

          Activity

            People

              richard Richard Moe Gustavsen
              richard Richard Moe Gustavsen
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes