I have a ListModel in QML:

Qt Code:
  1. ListModel{
  2. id: data
  3. ListElement
  4. {
  5. x: 10
  6. y: 20
  7. count: 18
  8. }
  9. }
  10.  
  11. function draw(){
  12. ctx.drawIntensityMap(data);
  13. }
  14.  
  15.  
  16. //********** c++ code
  17.  
  18. void Context2D::drawIntensityMap(QVariantList data)
  19. {
  20. ....
  21. }
To copy to clipboard, switch view to plain text mode 

The model just gets populated with x,y,count data via javascript. After it gets populated I want to pass it to my c++ function so I can draw a HeatMap with QPainter.
I can't figure out how to pass the data to my C++ function.

Would I have to pass it as a QVariantList? If so how would I get to the data in C++.

Thanks