Index: kbounce/renderer.cpp
===================================================================
--- kbounce/renderer.cpp	(revision 752082)
+++ kbounce/renderer.cpp	(working copy)
@@ -94,6 +94,7 @@
 	baseImage.fill( 0 );
 	QPainter p( &baseImage );
 	m_svgRenderer.render( &p, id );
+	p.end();
 	QPixmap renderedTile = QPixmap::fromImage( baseImage );
 	elementIt = m_tileCache.insert(id, renderedTile);
     }
Index: kbounce/wall.cpp
===================================================================
--- kbounce/wall.cpp	(revision 752082)
+++ kbounce/wall.cpp	(working copy)
@@ -183,6 +183,7 @@
 			width - tileWidth, tileHeight ) );
     }
     moveTo( m_board->mapPosition( m_boundingRect.topLeft() ) );
+    p.end();
     setPixmap( px );
 }
 
Index: kfourinline/src/thememanager.cpp
===================================================================
--- kfourinline/src/thememanager.cpp	(revision 752082)
+++ kfourinline/src/thememanager.cpp	(working copy)
@@ -194,6 +194,7 @@
   image.fill(0);
   QPainter p(&image);
   mRenderer->render(&p, svgid);
+  p.end();
   pixmap = QPixmap::fromImage(image);
   if (pixmap.isNull())
     kFatal() << "ThemeManager::getPixmap Cannot load svgid ID " << svgid;
Index: kgoldrunner/src/kgrcanvas.cpp
===================================================================
--- kgoldrunner/src/kgrcanvas.cpp	(revision 752082)
+++ kgoldrunner/src/kgrcanvas.cpp	(working copy)
@@ -622,6 +622,7 @@
 	}
     }
 
+    p.end();
     m_spotLight->setPicture(picture);
 }
 
Index: kjumpingcube/kcubeboxwidget.cpp
===================================================================
--- kjumpingcube/kcubeboxwidget.cpp	(revision 752082)
+++ kjumpingcube/kcubeboxwidget.cpp	(working copy)
@@ -547,6 +547,7 @@
    svg.render (&s, "lighting");
    svg.render (&s, "pip", QRectF (p - d/2.0, p - d/2.0, d, d));
    svg.render (&s, "pip", QRectF (p + p - d/2.0, p + p - d/2.0, d, d));
+   s.end();
    status2 = QPixmap::fromImage (status);
 }
 
@@ -557,6 +558,7 @@
    QPainter p (&img);
    img.fill (0);
    svg.render (&p, "background");
+   p.end();
    background = QPixmap::fromImage (img);
    qDebug() << t.restart() << "msec" << "SVG background rendered";
 }
@@ -565,13 +567,14 @@
 {
    qDebug() << t.restart() << "msec";
    QImage img (width, width, QImage::Format_ARGB32_Premultiplied);
-   QPainter q (&img);		// Paints whole faces of the dice.
+   QPainter q;                 // Paints whole faces of the dice.
 
    QImage pip (width/7, width/7, QImage::Format_ARGB32_Premultiplied);
-   QPainter r (&pip);		// Paints the pips on the faces of the dice.
+   QPainter r;                 // Paints the pips on the faces of the dice.
 
    elements.clear();
    for (int i = FirstElement; i <= LastElement; i++) {
+     q.begin(&img);
      if (i == Pip) {
        pip.fill (0);
      }
@@ -595,7 +598,9 @@
        svg.render (&q, "lighting");
        break;
      case Pip:
+       r.begin(&pip);
        svg.render (&r, "pip");
+       r.end();
        break;
      case BlinkLight:
        svg.render (&q, "blink_light");
@@ -606,7 +611,7 @@
      default:
        break;
      }
-
+     q.end();
      elements.append
        ((i == Pip) ? QPixmap::fromImage (pip) : QPixmap::fromImage (img));
    }
Index: kmahjongg/Editor.cpp
===================================================================
--- kmahjongg/Editor.cpp	(revision 752082)
+++ kmahjongg/Editor.cpp	(working copy)
@@ -410,6 +410,7 @@
     drawTiles(&buff);
     QPainter p(dest);
     p.drawPixmap(0,0, buff);
+    p.end();
 
     drawFrame->update();
 }
Index: kmines/renderer.cpp
===================================================================
--- kmines/renderer.cpp	(revision 752082)
+++ kmines/renderer.cpp	(working copy)
@@ -160,6 +160,7 @@
         bkgnd.fill(Qt::transparent);
         QPainter p(&bkgnd);
         m_renderer->render(&p, "mainWidget");
+        p.end();
         m_cache->insert(cacheName, bkgnd);
         kDebug() << "cache size:" << m_cache->size() << "kb";
     }
Index: knetwalk/src/renderer.cpp
===================================================================
--- knetwalk/src/renderer.cpp	(revision 752082)
+++ knetwalk/src/renderer.cpp	(working copy)
@@ -121,6 +121,7 @@
         pixmap.fill(Qt::red); // TODO: testing only make transparent
         QPainter p(&pixmap);
         m_renderer->render(&p, "background", bgRect);
+        p.end();
         m_cache->insert(cacheName, pixmap);
         kDebug() << "cache size:" << m_cache->size() << "kb";
     }
@@ -139,6 +140,7 @@
         pixmap.fill(Qt::transparent);
         QPainter p(&pixmap);
         m_renderer->render(&p, "overlay");
+        p.end();
         
         m_cache->insert(cacheName, pixmap);
         kDebug() << "cache size:" << m_cache->size() << "kb";
@@ -164,8 +166,7 @@
     QRectF boundingRect(CellBorder * size, CellBorder * size, 
                         ratio * size, ratio * size);
     
-    QPainter painter;
-    painter.begin(&pixmap);
+    QPainter painter(&pixmap);
     m_renderer->render(&painter, elementId, boundingRect);
     painter.end();
     
@@ -197,6 +198,7 @@
     pixmap.fill(Qt::transparent);
     QPainter p(&pixmap);
     m_renderer->render(&p, elementId, boundingRect);
+    p.end();
     
     m_cache->insert(cacheName, pixmap);
     kDebug() << "cache size:" << m_cache->size() << "kb";
Index: kolf/kolfsvgrenderer.cpp
===================================================================
--- kolf/kolfsvgrenderer.cpp	(revision 752082)
+++ kolf/kolfsvgrenderer.cpp	(working copy)
@@ -51,6 +51,7 @@
 	baseImg.fill(0);
 	QPainter p(&baseImg);
 	renderer->render(&p, name, QRectF(0, 0, width, height));
+	p.end();
 	QPixmap pix = QPixmap::fromImage(baseImg);
 
 	return pix;
@@ -64,6 +65,7 @@
 		baseImg.fill(0);
 		QPainter p(&baseImg);
 		renderer->render(&p, name, QRectF(0, 0, width, height));
+		p.end();
 		QPixmap pix = QPixmap::fromImage(baseImg);
 		QPixmapCache::insert(name, pix);
 	}
Index: ksame/renderer.cpp
===================================================================
--- ksame/renderer.cpp	(revision 752082)
+++ ksame/renderer.cpp	(working copy)
@@ -89,6 +89,7 @@
 		// Render the SVG element onto the image
 		QPainter p( &baseImage );
 		m_svgRenderer.render( &p, elementId );
+		p.end();
 		// Convert the image to a pixmap
 		QPixmap renderedElement = QPixmap::fromImage( baseImage );
 		// Add it to the cache
@@ -122,6 +123,7 @@
 		m_cachedBackground = QPixmap( m_backgroundSize );
 		QPainter p( &m_cachedBackground );
 		m_svgRenderer.render( &p, "background" );
+		p.end();
 	}
 	// Return the background from the cache
 	return m_cachedBackground;
Index: ktuberling/playground.cpp
===================================================================
--- ktuberling/playground.cpp	(revision 752082)
+++ ktuberling/playground.cpp	(working copy)
@@ -95,6 +95,7 @@
   QPixmap result(backgroundRect().size().toSize());
   QPainter artist(&result);
   render(&artist, QRectF(), backgroundRect().toRect());
+  artist.end();
   return result;
 }
 
Index: ktuberling/todraw.cpp
===================================================================
--- ktuberling/todraw.cpp	(revision 752082)
+++ ktuberling/todraw.cpp	(working copy)
@@ -26,6 +26,7 @@
   p2.drawRect(0, 0, width, height);
   p2.setCompositionMode(QPainter::CompositionMode_SourceOver);
   renderer->render(&p2, element);
+  p2.end();
   return img;
 }
 
@@ -85,6 +86,7 @@
 		p2.drawRect(0, 0, qRound(bounds.width()), qRound(bounds.height()));
 		p2.setCompositionMode(QPainter::CompositionMode_SourceOver);
 		renderer()->render(&p2, elementId());
+		p2.end();
 		painter->setWorldMatrix(QMatrix());
 		
 		painter->drawImage(pos() + QPointF(xStart, yStart), img, QRectF(xStart, yStart, bounds.width() - widthCut, bounds.height() - heightCut));
Index: libkdegames/digits/kgamesvgdigits.cpp
===================================================================
--- libkdegames/digits/kgamesvgdigits.cpp	(revision 752082)
+++ libkdegames/digits/kgamesvgdigits.cpp	(working copy)
@@ -553,6 +553,7 @@
                       << characterToDisplay << "Skipping.";
         }
     }
+    painter.end();
     return finalPixmap.copy(0, 0, width + x + paddingRight(), height + paddingTop() + paddingBottom());
 //     return finalPixmap.copy(0, 0, width + x, height);
 }
@@ -1058,8 +1059,8 @@
     pixmap.fill(alpha);
 
     QPainter painter (&pixmap);
-
     m_svgRenderer.render(&painter, m_elementId, viewport);
+    painter.end();
 
     if (m_cacheOption != KGameSvgDigits::CacheNone)
     {
Index: libkdegames/kchatbase.cpp
===================================================================
--- libkdegames/kchatbase.cpp	(revision 752082)
+++ libkdegames/kchatbase.cpp	(working copy)
@@ -30,7 +30,6 @@
 #include <kglobal.h>
 #include <QLayout>
 #include <QComboBox>
-#include <QPainter>
 #include <QPixmap>
 #include <QList>
 #include <QApplication>
Index: libkdegames/kgamethemeselector.cpp
===================================================================
--- libkdegames/kgamethemeselector.cpp	(revision 752082)
+++ libkdegames/kgamethemeselector.cpp	(working copy)
@@ -20,7 +20,6 @@
 
 #include <KLocale>
 #include <KStandardDirs>
-#include <QtGui/QPainter>
 #include <KConfigSkeleton>
 #include <knewstuff2/engine.h>
 #include <KComponentData>
Index: libkmahjongg/kmahjonggbackgroundselector.cpp
===================================================================
--- libkmahjongg/kmahjonggbackgroundselector.cpp	(revision 752082)
+++ libkmahjongg/kmahjonggbackgroundselector.cpp	(working copy)
@@ -94,6 +94,7 @@
     qiRend.fill(0);
     QPainter p(&qiRend);
     p.fillRect(p.viewport(), selBG->getBackground() );
+    p.end();
     backgroundPreview->setPixmap(QPixmap::fromImage(qiRend));
 
 }
Index: libkmahjongg/kmahjonggtilesetselector.cpp
===================================================================
--- libkmahjongg/kmahjonggtilesetselector.cpp	(revision 752082)
+++ libkmahjongg/kmahjonggtilesetselector.cpp	(working copy)
@@ -101,6 +101,7 @@
     //Draw unselected tile and first tileface
     p.drawPixmap(margin.width()/2, margin.height()/2, selTileset->unselectedTile(1));
     p.drawPixmap(margin.width()/2, margin.height()/2, selTileset->tileface(0));
+    p.end();
     tilesetPreview->setPixmap(QPixmap::fromImage(qiRend));
 
 }
Index: lskat/src/thememanager.cpp
===================================================================
--- lskat/src/thememanager.cpp	(revision 752082)
+++ lskat/src/thememanager.cpp	(working copy)
@@ -387,6 +387,7 @@
   image.fill(0);
   QPainter p(&image);
   renderer->render(&p, svgid);
+  p.end();
   pixmap = QPixmap::fromImage(image);
   if (pixmap.isNull())
     kFatal() << "ThemeManager::getPixmap Cannot load svgid ID" << svgid;
