cmessineo
18th December 2013, 19:11
I have a ListModel in QML:
ListModel{
id: data
ListElement
{
x: 10
y: 20
count: 18
}
}
function draw(){
ctx.drawIntensityMap(data);
}
//********** c++ code
void Context2D::drawIntensityMap(QVariantList data)
{
....
}
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
ListModel{
id: data
ListElement
{
x: 10
y: 20
count: 18
}
}
function draw(){
ctx.drawIntensityMap(data);
}
//********** c++ code
void Context2D::drawIntensityMap(QVariantList data)
{
....
}
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