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

Introduce a QML tree model

    XMLWordPrintable

Details

    • 89
    • Foundation Sprint 118, Foundation Sprint 119, Foundation Sprint 120, Foundation Sprint 121, Foundation Sprint 122, Foundation Sprint 123, Foundation Sprint 124, Foundation Sprint 125, Foundation Sprint 126, Foundation Sprint 127

    Description

      Goal

      Introduce a QML type to create and store tree-like data structures (e.g. JavaScript/JSON objects) for a tree model to be used with TreeView. It is intended to support simple models with pure QML; without requiring the creation of a custom QAbstractItemModel subclass in C++.

      Description

      The model can be stored as a simple collection of nodes with hierarchical relationship between them. A node can have multiple children but only one parent (with the exception of the root node)

      The basic functionalities are expected from QML:

      Node management:

      • Dynamically add or remove nodes
      • Enable node set/update (directly in the model or by using custom delegates)
      • Be able to move a node in the structure

      Tree traversal

      • Easily traverse the tree model
      • Iterate the model

      Relationship:

      • Parent and child access on the node level

      Event handling:

      • Be able to update the tree on changes in the model

      Data validation:

      • Consider invalid models, for instance, a child having multiple parents

      Tree data:

      • Be able to query the number of edges and the depth of a node

      Notes

      • Consider performance implication for large data sets.
      • Consider future improvements where user could add data from XML tree models or JSON files.
      • Consider future improvements to search the model
      • Consider the possibility to switch the same model as tree or table view.

      Attachments

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

        Activity

          People

            mate Máté Barany
            mastambo Maycon Stamboroski
            Maycon Stamboroski Maycon Stamboroski
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes