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

Improve documentation for using a TreeModel in a Qt Quick UI

    XMLWordPrintable

Details

    • 1fca1477e (dev), 50064d6cf (6.8)

    Description

      Our TreeView documentation is not showing how the tree model can be created:

      https://doc.qt.io/qt-6/qml-qtquick-treeview.html

      Therefore, the example doesn't work (the user have to create a C++ model):
      // The model needs to be a QAbstractItemModel// model: yourTreeModel
       

      For reference

      There is one example that uses a FileSystemModule.FileSystemModel as a model. This is defined in C++:

      qtdeclarative/examples/quickcontrols/filesystemexplorer/qml/FileSystemView.qml

       

      There's also a manual test. My hunch would be to use it's TestModel as a base of how to create a C++ tree view model for the TreeView documentation:

      qtdeclarative/tests/manual/treeview/sidebyside

       

      Attachments

        Issue Links

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

          Activity

            People

              santhoshkumar Santhosh Kumar Selvaraj
              smd Jan Arve
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes