void QCustomPlot::replot(QCustomPlot::RefreshPriority refreshPriority),This method traverses QCPLayer
foreach (QCPLayer *layer, mLayers) layer->drawToPaintBuffer();
Then, in QQuickPaintedItem->paint() , The draw method will be called again, So, how do you avoid multiple traversals ?
if (mPlot) { QPixmap picture( boundingRect().size().toSize() ); picture.fill(Qt::transparent); QCPPainter qcpPainter( &picture ); mPlot->toPainter( &qcpPainter); painter->drawPixmap( QPoint(), picture ); }