Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Handling complicated data model vector of vectors.
Forum Update on Monday, May 27th 2025

Handling complicated data model vector of vectors.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 253 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.
  • G Offline
    G Offline
    GoRo3
    wrote on last edited by
    #1

    Hi!

    I was looking for answers in the web but nothing found. I'm writing IoT app that stores information from many sensors connected by some interface (it's not important write now). And i;m looking for way that i could pass data from this sensors to QML.

    The complication is that base class for data is "node" class that holds all properties needed for identification device like uuid, name and some serialization interface. And in "node" class there is another data structure witch is vector of different sensors. All sensors are derived from base class and have property (enum) that holds their type like: humidity, temperature, pressure etc. and of cors data.

    So summarizing i have vector of nodes, where individual nodes could store another vector of sensors connected to this nodes.
    And now how to pass this data to QML? I'm familiar with Qt model/view concept, but in situation i have in model vector of vectors and need to filter data from second vector to show for example temperature readings of current node.

    hope that I have presented the problem clearly and there is some solution.

    Best Regards!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Wouldn't it be more practical to store these information in a database and then use the model view architecture to load what you want ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • G Offline
        G Offline
        GoRo3
        wrote on last edited by
        #3

        Hmm.... it sounds good - sometimes is nice to have some outside view. Witch database do you recommend to work with that cain of data? Normal SQL with "node" object and relations to sensor readings? It will not be to slow?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          It will depend on the volume of data you are expecting to get and store.

          But that's a good starting point.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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