diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2020-09-01 13:45:24 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2020-09-10 17:28:11 +0200 |
commit | b3c991ae8f9da6d8eb26f10b3d4ab08587588c9e (patch) | |
tree | 8f2ff32cadf9b8733701b8f99229a6135f53f7d7 /examples/corelib/threads/mandelbrot | |
parent | e1ce78d48498a3de21fe4714e92e2c0fcf1a0813 (diff) |
Port from devicePixelRatioF() to devicePixelRatio()
This ports all of QtBase.
Change-Id: If6712da44d7749b97b74f4614a04fac360f69d9e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'examples/corelib/threads/mandelbrot')
-rw-r--r-- | examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp b/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp index 9eda882347..b0c3733b22 100644 --- a/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp +++ b/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp @@ -107,9 +107,9 @@ void MandelbrotWidget::paintEvent(QPaintEvent * /* event */) //! [6] //! [7] } else { //! [7] //! [8] - auto previewPixmap = qFuzzyCompare(pixmap.devicePixelRatioF(), qreal(1)) + auto previewPixmap = qFuzzyCompare(pixmap.devicePixelRatio(), qreal(1)) ? pixmap - : pixmap.scaled(pixmap.size() / pixmap.devicePixelRatioF(), Qt::KeepAspectRatio, + : pixmap.scaled(pixmap.size() / pixmap.devicePixelRatio(), Qt::KeepAspectRatio, Qt::SmoothTransformation); double scaleFactor = pixmapScale / curScale; int newWidth = int(previewPixmap.width() * scaleFactor); @@ -143,7 +143,7 @@ void MandelbrotWidget::paintEvent(QPaintEvent * /* event */) //! [10] void MandelbrotWidget::resizeEvent(QResizeEvent * /* event */) { - thread.render(centerX, centerY, curScale, size(), devicePixelRatioF()); + thread.render(centerX, centerY, curScale, size(), devicePixelRatio()); } //! [10] @@ -212,7 +212,7 @@ void MandelbrotWidget::mouseReleaseEvent(QMouseEvent *event) pixmapOffset += event->position().toPoint() - lastDragPos; lastDragPos = QPoint(); - const auto pixmapSize = pixmap.size() / pixmap.devicePixelRatioF(); + const auto pixmapSize = pixmap.size() / pixmap.devicePixelRatio(); int deltaX = (width() - pixmapSize.width()) / 2 - pixmapOffset.x(); int deltaY = (height() - pixmapSize.height()) / 2 - pixmapOffset.y(); scroll(deltaX, deltaY); @@ -239,7 +239,7 @@ void MandelbrotWidget::zoom(double zoomFactor) { curScale *= zoomFactor; update(); - thread.render(centerX, centerY, curScale, size(), devicePixelRatioF()); + thread.render(centerX, centerY, curScale, size(), devicePixelRatio()); } //! [17] @@ -249,6 +249,6 @@ void MandelbrotWidget::scroll(int deltaX, int deltaY) centerX += deltaX * curScale; centerY += deltaY * curScale; update(); - thread.render(centerX, centerY, curScale, size(), devicePixelRatioF()); + thread.render(centerX, centerY, curScale, size(), devicePixelRatio()); } //! [18] |