Every time the laser scanner performs one measurement, you have four data to process: x, y (scanner position), phi (angle) and r (measured distance). This results in a single straight line starting at (x,y) with direction phi and length r, and a black dot at the end, as shown in the images. Everything else in the image stays the same. This is easily doable, also with QPainter. Just create a buffer QPixmap which is initially filled gray once. Then, at every scanner iteration, use drawLine and drawEllipse to draw the line and black dot respectively. These two operations are extremely fast, much faster than painting 16 million pixels individually.
In the paint event of your widget, create a QPainter(this) as you did previously, and now use drawPixmap to draw the visible portion (->scrollbars) of the pixmap onto your widget surface. This, too, is very fast.
That should solve your problem.
Further I suggest you don't fix your coordinate system to 40004000 but adjust its size dynamically. What would you do when the area the scanner sees is very narrow but longer than 4000 pixels? Or why waste so much memory when the area it sees in one run is maybe just 500500?