Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Brainstorm
  4. TreeModelView with (Realtime) Options
Forum Update on Monday, May 27th 2025

TreeModelView with (Realtime) Options

Scheduled Pinned Locked Moved Brainstorm
5 Posts 2 Posters 1.8k 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.
  • T Offline
    T Offline
    tedr56
    wrote on last edited by
    #1

    Hey dear Qt users,
    I'm starting a big events router app and I figured the Qt Model/View could be usefull.

    The first step I want to achieve is to design the applications's architecture I want to control, mostly by OSC.
    To do that, I want to use a TreeModelView which store the app hierarchy which represent each Osc control I want to use. But I'm not very familiar (yet) with the Model workflow.
    My problem is for each node, I want options like Osc Path, the actual value. And I don't know wich solution is best.

    The way I see it I have multiple choices.

    • Options as Children Items of the node

    Pros : Updated by Viewer

    Cons : Seems difficult to get track of Parents/Children. Do I need to define a new Item class for each options?

    • Options as Q_Property of the Node

    Pros :/

    Cons : Loosing the AutoView Update

    • Options as a ItemData class

    Pros : kind of an interface to put all options in one place

    Cons : Loosing the AutoView Update

    • Options as CustomRoles

    Pros : All data in one place

    Cons : Editing may be a problem

    I can't figure which is best. Maybe I missed a solution there.

    The secondary question is the Realtime side of this application.
    If I store the actual values of each controls as a TreeItem, can the Model/View system handle all these changing values laglessly?

    Thanks in advance for any help.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Salvatello
      wrote on last edited by
      #2

      try to see here: http://qt-project.org/doc/qt-4.8/itemviews-simpletreemodel.html.
      if you have other questions let me know

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tedr56
        wrote on last edited by
        #3

        Thanks but I know about this example.
        That's would be my solution 1.
        Are you saying I should use this one?
        If that so, is it possible to store the realtime value in a children?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Salvatello
          wrote on last edited by
          #4

          yes, is possible to store the realtime value in a fhater and children

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tedr56
            wrote on last edited by
            #5

            Thanks for the input.

            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