you need some more c++-knowledge, your problems are not qwt-related. the vectors x and y are declared within scope of the loop. you can't access them when you left the loop. have you ever filled an array with a loop?
in "fonction", you don't need the call "points.clear()" since the vector is empty when you create it. is there any reason for the "sleep(5000)"?
ok, I'll help you with some code. I suggest to get back to QPolygonF. Then you can return a QPointF in "fonction()" directly. This is more intuitive and you can forget all the QVector stuff you don't need... I'll give you the modified loop and let you adapt "fonction()" by yourself. I'll help you when you can't manage that.
for(unsigned int i=0; i<10; i++)
polygon << fonction();
curve->setSamples(polygon); // maybe you need more parameters...
QPolygonF polygon;
for(unsigned int i=0; i<10; i++)
polygon << fonction();
curve->setSamples(polygon); // maybe you need more parameters...
To copy to clipboard, switch view to plain text mode
Bookmarks