+QImage TestViewer::diff( const QImage& theExpectedRefImage, const QImage& theActualImage )
+{
+ const QImage::Format aFormat = QImage::Format_RGB32;
+
+ QImage anExpectedRefImage = theExpectedRefImage.convertToFormat( aFormat );
+ QImage anActualImage = theActualImage.convertToFormat( aFormat );
+
+ QImage aDiff( anExpectedRefImage.width(), anExpectedRefImage.height(), aFormat );
+ QPainter aPainter( &aDiff );
+ aPainter.drawImage( 0, 0, anExpectedRefImage );
+ aPainter.setCompositionMode( QPainter::RasterOp_SourceXorDestination );
+ aPainter.drawImage( 0, 0, anActualImage );
+ return aDiff;
+}
+