QCustomPlot Discussion and Comments

How do I avoid calling draw multiple times when QML is used?Return to overview

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 );
    }

Did you ever work this out?