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. QAbstractitemmodel feeding Chartview

QAbstractitemmodel feeding Chartview

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

    Hello, I see in Oscilloscope example that the update of Lineseries is done by sending the series pointer from qml to C++. So, no of line series is controlled by qml. But I am wondering if it is possible to create lineseries for the chartview depending upon the no of items in the QAbstractitemmodel.

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      You can do it just like any other C++ class. Please note that LineSeries is not using the modelView framework. So you will not be able to use the QAbstractitemmodel like a model concept. You need to expose the properties from QAbstractitemmodel just like any other C++ object you expose to qml.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      M 1 Reply Last reply
      0
      • dheerendraD dheerendra

        You can do it just like any other C++ class. Please note that LineSeries is not using the modelView framework. So you will not be able to use the QAbstractitemmodel like a model concept. You need to expose the properties from QAbstractitemmodel just like any other C++ object you expose to qml.

        M Offline
        M Offline
        milan
        wrote on last edited by
        #3

        @dheerendra . Thanks for your reply. Okay I understand I cannot use model-view concept for charts. But depending upon the items which is Q_PROPERTY, can I generate same no. of series in charts?

        1 Reply Last reply
        0
        • dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Qt Champions 2022
          wrote on last edited by
          #4

          This can be done. Nothing stops you from using the Model object as normal C++ object. As best practice not very useful. If there is case where you are already using the model object, you can use here as well in your program.

          Dheerendra
          @Community Service
          Certified Qt Specialist
          http://www.pthinks.com

          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