diff options
Diffstat (limited to 'examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp')
-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] |