Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.1
-
None
-
Harmattan Scratchbox
-
9a63863d6f0c614c041c3d4b375bf88d93148ef7, eac9e6a11e7727d8a749242f317362337ce89a1d
Description
In the code below a pixmap is created. We then create a copy of the pixmap and save it as QImage. The pixmap is then modified and a second copy is created.
With the native graphicssystem both images are different as expected - with the raster graphicssystem both images have the same content. No deep copy is created.
If e.g. p->fill() is called a second time after the first copy has been made the deep copy is created as expected.
QPixmap *p = new QPixmap(300, 300);
p->fill(QColor(255, 255, 255, 0));
QPainter *myPainter = new QPainter(p);
QImage img1 = p->toImage();
img1.save("/tmp/img1.png");
myPainter->setBrush(Qt::black);
myPainter->drawEllipse(10, 10, 100, 100);
QImage img2 = p->toImage();
img2.save("/tmp/img2.png");
if (img1 == img2)
{ qWarning("FAIL!"); }