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. Advice on subclassing QAbstractItemModel

Advice on subclassing QAbstractItemModel

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 713 Views 1 Watching
  • 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.
  • T Offline
    T Offline
    tilsitt
    wrote on last edited by
    #1

    Hi,

    I have a data structure representing a processing pipeline, similar e.g. to the pipeline defined in the ITK library: process objects contains data objects as outputs which could then be referenced as inputs for another process object, etc.

    I am considering the QAbstractItemModel interface to benefits the model/view tools of Qt but I don't find a "good" way to index the objects of my pipeline. The way I see it is to index both the process and the data objects (and use the flags to specialize the options into the model): the QModelIndex corresponding to a process object would have children, each one corresponding to one of its outputs, and the QModelIndex of a data object would have children, each one corresponding to one of its "followers" (a process object referencing it as an input).

    The problem is that if a given process object has multiple inputs its QModelIndex would have multiple QModelIndex as parent, which looks not possible if I understand the documentation(?)

    Did anyone try to subclass QAbstractItemModel like this? Any advice would be greatly appreciated.

    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