summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsscene
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2010-09-13 14:23:04 +0200
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2010-09-13 15:17:01 +0200
commit548155fec3a8b575215625d4fd767e63c20f6b84 (patch)
treede72a03ef2705665bf9dee7a1b0ae8a469e1c651 /tests/auto/qgraphicsscene
parent0313095b876e86cee5a83a3147aa182e1f2061b8 (diff)
Assertion calledEmitUpdated fails in QGraphicsScene.
Problem was that the 'updateAll' boolean was reset to 'false' when it really should have been unchanged. This happened when rendering the scene from outside the view's paint event (i.e. from QGraphicsView/Scene::render). We only want to reset 'updateAll' when triggering drawItems() from QGraphicsView::paintEvent, i.e. when the 'view' pointer != 0. Broke after commit: dda8a57c. Auto test included. Task-number: QT-3674
Diffstat (limited to 'tests/auto/qgraphicsscene')
-rw-r--r--tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
index c145623240..b8e729eb7c 100644
--- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -287,6 +287,7 @@ private slots:
void taskQTBUG_5904_crashWithDeviceCoordinateCache();
void taskQT657_paintIntoCacheWithTransparentParts();
void taskQTBUG_7863_paintIntoCacheWithTransparentParts();
+ void taskQT_3674_doNotCrash();
};
void tst_QGraphicsScene::initTestCase()
@@ -4565,6 +4566,25 @@ void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts()
}
}
+void tst_QGraphicsScene::taskQT_3674_doNotCrash()
+{
+ QGraphicsScene scene;
+
+ QGraphicsView view(&scene);
+ view.resize(200, 200);
+
+ QPixmap pixmap(view.size());
+ QPainter painter(&pixmap);
+ view.render(&painter);
+ painter.end();
+
+ scene.addItem(new QGraphicsWidget);
+ scene.setBackgroundBrush(Qt::green);
+
+ QApplication::processEvents();
+ QApplication::processEvents();
+}
+
void tst_QGraphicsScene::zeroScale()
{
//should not crash