MCPcopy Create free account
hub / github.com/LUX-Core/lux / setBufferDevicePixelRatio

Method setBufferDevicePixelRatio

src/qt/qcustomplot.cpp:13389–13403  ·  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

13387 leaves the internal buffer device pixel ratio at 1.0.
13388*/
13389void QCustomPlot::setBufferDevicePixelRatio(double ratio)
13390{
13391 if (!qFuzzyCompare(ratio, mBufferDevicePixelRatio))
13392 {
13393#ifdef QCP_DEVICEPIXELRATIO_SUPPORTED
13394 mBufferDevicePixelRatio = ratio;
13395 for (int i=0; i<mPaintBuffers.size(); ++i)
13396 mPaintBuffers.at(i)->setDevicePixelRatio(mBufferDevicePixelRatio);
13397 // Note: axis label cache has devicePixelRatio as part of cache hash, so no need to manually clear cache here
13398#else
13399 qDebug() << Q_FUNC_INFO << "Device pixel ratios not supported for Qt versions before 5.4";
13400 mBufferDevicePixelRatio = 1.0;
13401#endif
13402 }
13403}
13404
13405/*!
13406 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
sizeMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected