I'm trying to implement high DPI support for this qml solution https://github.com/mosolovsa/qmlplot

void CustomPlotItem::paint( QPainter* painter )
{
    if (m_CustomPlot)
    {
        QPixmap    picture( boundingRect().size().toSize() * window()->effectiveDevicePixelRatio() );

        picture.setDevicePixelRatio(window()->effectiveDevicePixelRatio());
        QCPPainter qcpPainter( &picture );

        m_CustomPlot->toPainter( &qcpPainter );

        painter->drawPixmap( QPoint(), picture);
    }
}

All works fine, but any effectiveDevicePixelRatio() other than 1 causes huge lags and very low fps.

What am i doing wrong?