I'm too bad I did not understand "Qpolygon" so I tried something else:
main.cpp
#include <QApplication>
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <vector>
#include "function.hpp"
using namespace std;
int main(int argc, char** argv)
{
myCurve.attach(&myPlot);
for (int i=1;i<10;i++)
{
vector<double> points;
points=function();
QVector<double> x(1);
QVector<double> y(1);
x.append( points[0]);
y.append( points[1]);
}
myCurve.setSamples(x.data(),y.data(),x.size());
myPlot.replot();
myPlot.show();
return app.exec();
}
#include <QApplication>
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <vector>
#include "function.hpp"
using namespace std;
int main(int argc, char** argv)
{
QApplication app(argc,argv);
QwtPlot myPlot;
QwtPlotCurve myCurve;
myCurve.attach(&myPlot);
for (int i=1;i<10;i++)
{
vector<double> points;
points=function();
QVector<double> x(1);
QVector<double> y(1);
x.append( points[0]);
y.append( points[1]);
}
myCurve.setSamples(x.data(),y.data(),x.size());
myPlot.replot();
myPlot.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
function.cpp
#include <vector>
#include <ctime> // to generate random point
#include <cstdlib> // to generate random point
#include "function.hpp"
using namespace std;
vector<double> function()
{
vector<double> points;
srand(time(0));
points.clear();
Sleep(5000);
points.push_back(rand() % 1800);
points.push_back(rand() % 500);
return points;
}
#include <vector>
#include <ctime> // to generate random point
#include <cstdlib> // to generate random point
#include "function.hpp"
using namespace std;
vector<double> function()
{
vector<double> points;
srand(time(0));
points.clear();
Sleep(5000);
points.push_back(rand() % 1800);
points.push_back(rand() % 500);
return points;
}
To copy to clipboard, switch view to plain text mode
function.hpp
#ifndef FUNCTION_HPP
#define FUNCTION_HPP
std::vector<double> function();
#endif // FUNCTION_HPP
#ifndef FUNCTION_HPP
#define FUNCTION_HPP
std::vector<double> function();
#endif // FUNCTION_HPP
To copy to clipboard, switch view to plain text mode
but this code say:
X and Y are not declared in this scope, but i have declared this values??? 
can you help me 
i bloc with Qwt until 3week just to plot a plot with some points
Bookmarks