Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Custom model of nested lists to QML
QtWS25 Last Chance

Custom model of nested lists to QML

Scheduled Pinned Locked Moved Unsolved General and Desktop
qabstractitemmoqabstractlistmoqmlmodel-view
2 Posts 1 Posters 482 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    EStudley
    wrote on last edited by EStudley
    #1

    Hello,

    What's the best approach to creating a role that exposes a list in QML?

    There is a list of players and their bug reports. This is how the data is structured:

    • NameRole,
    • AgeRole,
    • CreatedDatetimeRole,
    • ChangedDatetimeRole,
    • ReportsRole: [
      • ReportNameRole,
      • ReportDescriptionRole,
      • ReportDateRole,
      • ReportId
        ]

    Originally I thought of a QAbstractListItem that returns a QAbstractListItem as a QObject-cast-to-QVariant role? It does not seem to fit the TreeItem/TreeModel example as the roles are different between parent/child.

    Thoughts?

    1 Reply Last reply
    0
    • E Offline
      E Offline
      EStudley
      wrote on last edited by
      #2

      Still not sure what's the best design here.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved