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. Passing a vector to qml
Qt 6.11 is out! See what's new in the release blog

Passing a vector to qml

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 2 Posters 2.2k 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
    maxwell31
    wrote on last edited by
    #1

    Hi,

    I have a qml app which displays a time-series plot. From the c++ backend, I have a list of marks, which each have a time value and a string label. I would like to draw these marks over the plot (embedded in my qml file) using qml rectangles.

    How can I pass this list to qml?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      TobbY
      wrote on last edited by
      #2

      Hi,
      i think this will solve your problem.
      https://stackoverflow.com/questions/35749873/how-to-pass-a-list-vector-or-array-as-argument-in-invokemethod-function/35751146

      1 Reply Last reply
      3
      • M Offline
        M Offline
        maxwell31
        wrote on last edited by
        #3

        Thanks. I am trying this now and will report later

        1 Reply Last reply
        0
        • M Offline
          M Offline
          maxwell31
          wrote on last edited by
          #4

          Yes, this works perfectly

          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