summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpixmap
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-12-13 10:39:16 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-12-13 10:39:16 (GMT)
commitd369ae7b831744c796571aa86b5d6570b09e70e4 (patch)
tree0ad8abef937ac3009f32b600a8e3b5644d7c637c /tests/auto/qpixmap
parentc8a2533cb39ce0c7479880cd889ad594d569ecc0 (diff)
parent044708cb7f7fd1f2d7b18d20269422e7f3a1cb83 (diff)
downloadQt-d369ae7b831744c796571aa86b5d6570b09e70e4.zip
Qt-d369ae7b831744c796571aa86b5d6570b09e70e4.tar.gz
Qt-d369ae7b831744c796571aa86b5d6570b09e70e4.tar.bz2
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts: configure src/gui/graphicsview/qgraphicslayout.cpp src/gui/text/qfontengine_s60.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/qwindowsurface_gl.cpp src/s60installs/bwins/QtGuiu.def src/s60installs/eabi/QtGuiu.def tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
Diffstat (limited to 'tests/auto/qpixmap')
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index 2cbd4f1..3ac54b9 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -131,10 +131,7 @@ private slots:
void isNull();
void task_246446();
-#ifdef Q_WS_QWS
void convertFromImageNoDetach();
-#endif
-
void convertFromImageDetach();
#if defined(Q_WS_WIN)
@@ -187,6 +184,8 @@ private slots:
void preserveDepth();
void splash_crash();
+ void toImageDeepCopy();
+
void loadAsBitmapOrPixmap();
};
@@ -927,11 +926,13 @@ void tst_QPixmap::isNull()
}
}
-#ifdef Q_WS_QWS
void tst_QPixmap::convertFromImageNoDetach()
{
+ QPixmap randomPixmap(10, 10);
+ if (randomPixmap.pixmapData()->classId() != QPixmapData::RasterClass)
+ QSKIP("Test only valid for raster pixmaps", SkipAll);
+
//first get the screen format
- QPixmap randomPixmap(10,10);
QImage::Format screenFormat = randomPixmap.toImage().format();
QVERIFY(screenFormat != QImage::Format_Invalid);
@@ -946,7 +947,6 @@ void tst_QPixmap::convertFromImageNoDetach()
const QImage constCopy = copy;
QVERIFY(constOrig.bits() == constCopy.bits());
}
-#endif //Q_WS_QWS
void tst_QPixmap::convertFromImageDetach()
{
@@ -1767,6 +1767,21 @@ void tst_QPixmap::loadAsBitmapOrPixmap()
QVERIFY(bitmap.isQBitmap());
}
+void tst_QPixmap::toImageDeepCopy()
+{
+ QPixmap pixmap(64, 64);
+ pixmap.fill(Qt::white);
+
+ QPainter painter(&pixmap);
+ QImage first = pixmap.toImage();
+
+ painter.setBrush(Qt::black);
+ painter.drawEllipse(pixmap.rect());
+
+ QImage second = pixmap.toImage();
+
+ QVERIFY(first != second);
+}
QTEST_MAIN(tst_QPixmap)