diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2010-09-13 12:23:04 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2010-09-13 13:17:01 (GMT) |
commit | 548155fec3a8b575215625d4fd767e63c20f6b84 (patch) | |
tree | de72a03ef2705665bf9dee7a1b0ae8a469e1c651 /tests/auto/qgraphicsscene | |
parent | 0313095b876e86cee5a83a3147aa182e1f2061b8 (diff) | |
download | Qt-548155fec3a8b575215625d4fd767e63c20f6b84.zip Qt-548155fec3a8b575215625d4fd767e63c20f6b84.tar.gz Qt-548155fec3a8b575215625d4fd767e63c20f6b84.tar.bz2 |
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.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp index c145623..b8e729e 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 |