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

Improve documentation for using a TreeModel in a Qt Quick UI

XMLWordPrintable

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

      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

       

        For Gerrit Dashboard: QTBUG-127016
        # Subject Branch Project Status CR V

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes