I'm using QGraphicsScene to display data. The data is a set of values, i.e., a vector. I put the data in QPainterPath or in a QPolygon and use .addPath or addPolygon. Here is the code:

scene.setSceneRect(0, maxV, nPoints, rangeV);
scene.clear();

pen.setColor(Qt::black);

path.moveTo(0,dataBuffer[0]);
for(i = 1; i < nPoints; i++)
path.lineTo(i,dataBuffer[i]);

rect = scene.sceneRect();
scene.addPath(path,pen);
ui->DataView->fitInView(rect);
.
.
.

The data displays OK except that a line is drawn from the last to first point, i.e., the path/polygon is closed. How do I instruct QGraphicsScene/QGraphicsView not to draw a line between the last and first point.

Thanks,

Muz