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
Forum Updated to NodeBB v4.3 + New Features

Custom model of nested lists to QML

Scheduled Pinned Locked Moved Unsolved General and Desktop
qabstractitemmoqabstractlistmoqmlmodel-view
2 Posts 1 Posters 511 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 23 Sept 2020, 00:34 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 23 Sept 2020, 13:52 last edited by
      #2

      Still not sure what's the best design here.

      1 Reply Last reply
      0

      2/2

      23 Sept 2020, 13:52

      • Login

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