summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsscene
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-12-13 11:39:16 +0100
committerOlivier Goffart <olivier.goffart@nokia.com>2010-12-13 11:39:16 +0100
commitd369ae7b831744c796571aa86b5d6570b09e70e4 (patch)
tree0ad8abef937ac3009f32b600a8e3b5644d7c637c /tests/auto/qgraphicsscene
parentc8a2533cb39ce0c7479880cd889ad594d569ecc0 (diff)
parent044708cb7f7fd1f2d7b18d20269422e7f3a1cb83 (diff)
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/qgraphicsscene')
-rw-r--r--tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
index 6a2f8490c9..588c4762d2 100644
--- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -288,6 +288,7 @@ private slots:
void taskQT657_paintIntoCacheWithTransparentParts();
void taskQTBUG_7863_paintIntoCacheWithTransparentParts();
void taskQT_3674_doNotCrash();
+ void taskQTBUG_15977_renderWithDeviceCoordinateCache();
};
void tst_QGraphicsScene::initTestCase()
@@ -4629,5 +4630,27 @@ void tst_QGraphicsScene::zeroScale()
QTRY_COMPARE(cl.changes.count(), 2);
}
+void tst_QGraphicsScene::taskQTBUG_15977_renderWithDeviceCoordinateCache()
+{
+ QGraphicsScene scene;
+ scene.setSceneRect(0, 0, 100, 100);
+ QGraphicsRectItem *rect = scene.addRect(0, 0, 100, 100);
+ rect->setPen(Qt::NoPen);
+ rect->setBrush(Qt::red);
+ rect->setCacheMode(QGraphicsItem::DeviceCoordinateCache);
+
+ QImage image(100, 100, QImage::Format_RGB32);
+ QPainter p(&image);
+ scene.render(&p);
+ p.end();
+
+ QImage expected(100, 100, QImage::Format_RGB32);
+ p.begin(&expected);
+ p.fillRect(expected.rect(), Qt::red);
+ p.end();
+
+ QCOMPARE(image, expected);
+}
+
QTEST_MAIN(tst_QGraphicsScene)
#include "tst_qgraphicsscene.moc"