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. Passing a QVector from Cpp to qml
Forum Updated to NodeBB v4.3 + New Features

Passing a QVector from Cpp to qml

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 554 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.
  • L Offline
    L Offline
    Luckless
    wrote on last edited by
    #1

    I have a QVector<QPointF> variable in c++ class. I want to access and iterate this variable in canvas that i have in my qml file. Please give an example of how i can achieve this.

    1 Reply Last reply
    0
    • Pradeep KumarP Offline
      Pradeep KumarP Offline
      Pradeep Kumar
      wrote on last edited by
      #2

      Hi @Luckless ,

      From where do you get the values for QPointF ?
      you cannot directly pass QPoint, send it in the list .

      refer the below for QMl types which supports.
      https://doc.qt.io/qt-5/qtqml-cppintegration-data.html#sequence-type-to-javascript-array

      Thanks,

      Pradeep Kumar
      Qt,QML Developer

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved