summaryrefslogtreecommitdiffstats
path: root/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp')
-rw-r--r--examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp b/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp
index b3e4af5dc8..71d0abb09f 100644
--- a/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp
+++ b/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp
@@ -48,14 +48,13 @@
**
****************************************************************************/
+#include "mandelbrotwidget.h"
+
#include <QPainter>
#include <QKeyEvent>
#include <math.h>
-#include "mandelbrotwidget.h"
-
-
//! [0]
const double DefaultCenterX = -0.637011f;
const double DefaultCenterY = -0.0395159f;
@@ -75,7 +74,8 @@ MandelbrotWidget::MandelbrotWidget(QWidget *parent)
pixmapScale = DefaultScale;
curScale = DefaultScale;
- connect(&thread, SIGNAL(renderedImage(QImage,double)), this, SLOT(updatePixmap(QImage,double)));
+ connect(&thread, &RenderThread::renderedImage,
+ this, &MandelbrotWidget::updatePixmap);
setWindowTitle(tr("Mandelbrot"));
#ifndef QT_NO_CURSOR
@@ -117,7 +117,8 @@ void MandelbrotWidget::paintEvent(QPaintEvent * /* event */)
painter.save();
painter.translate(newX, newY);
painter.scale(scaleFactor, scaleFactor);
- QRectF exposed = painter.matrix().inverted().mapRect(rect()).adjusted(-1, -1, 1, 1);
+
+ QRectF exposed = painter.transform().inverted().mapRect(rect()).adjusted(-1, -1, 1, 1);
painter.drawPixmap(exposed, pixmap, exposed);
painter.restore();
}