MCPcopy Create free account
hub / github.com/CieNTi/serial_port_plotter / setBufferDevicePixelRatio

Method setBufferDevicePixelRatio

qcustomplot/qcustomplot.cpp:13400–13414  ·  view source on GitHub ↗

! Sets the device pixel ratio used by the paint buffers of this QCustomPlot instance. Normally, this doesn't need to be set manually, because it is initialized with the regular \a QWidget::devicePixelRatio which is configured by Qt to fit the display device (e.g. 1 for normal displays, 2 for High-DPI displays). Device pixel ratios are supported by Qt only for Qt versions since 5.4. If

Source from the content-addressed store, hash-verified

13398 leaves the internal buffer device pixel ratio at 1.0.
13399*/
13400void QCustomPlot::setBufferDevicePixelRatio(double ratio)
13401{
13402 if (!qFuzzyCompare(ratio, mBufferDevicePixelRatio))
13403 {
13404#ifdef QCP_DEVICEPIXELRATIO_SUPPORTED
13405 mBufferDevicePixelRatio = ratio;
13406 for (int i=0; i<mPaintBuffers.size(); ++i)
13407 mPaintBuffers.at(i)->setDevicePixelRatio(mBufferDevicePixelRatio);
13408 // Note: axis label cache has devicePixelRatio as part of cache hash, so no need to manually clear cache here
13409#else
13410 qDebug() << Q_FUNC_INFO << "Device pixel ratios not supported for Qt versions before 5.4";
13411 mBufferDevicePixelRatio = 1.0;
13412#endif
13413 }
13414}
13415
13416/*!
13417 Sets \a pm as the viewport background pixmap (see \ref setViewport). The pixmap is always drawn

Callers

nothing calls this directly

Calls 3

setDevicePixelRatioMethod · 0.80
atMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected