diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-06-28 13:05:10 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-28 13:17:22 +0000 |
commit | 1d09b0d1b28eaea17069f7359956640f31ea79c6 (patch) | |
tree | 50f088207242d1ab789ee62b2bf5910d0d75791f /tests | |
parent | e2d79b496335e8d8666014e900930c66cf722eb6 (diff) | |
download | qtbase-1d09b0d1b28eaea17069f7359956640f31ea79c6.tar.gz |
QGraphicsScene::update(): Keep the list of updatedRects() unique
Otherwise, the rects will pile up when the item is not part of a view.
Task-number: QTBUG-54275
Change-Id: I29c989e25ce0ca1ac0b87d0388a476ef1acd9cfd
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp index 1130a47260..27eac03880 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp @@ -2206,10 +2206,11 @@ void tst_QGraphicsItem::setMatrix() QCOMPARE(spy.count(), 3); QList<QRectF> rlist = qvariant_cast<QList<QRectF> >(spy.last().at(0)); - QCOMPARE(rlist.size(), 3); - QCOMPARE(rlist.at(0), rotatedRect); // From item.setMatrix() (clearing rotated rect) - QCOMPARE(rlist.at(1), rotatedRect); // From scene.update() (updating scene rect) - QCOMPARE(rlist.at(2), unrotatedRect); // From post-update (update current state) + QCOMPARE(rlist.size(), 2); + // From item.setMatrix() (clearing rotated rect), from scene.update() (updating scene rect), + // squashed into one + QCOMPARE(rlist.at(0), rotatedRect); + QCOMPARE(rlist.at(1), unrotatedRect); // From post-update (update current state) } static QList<QGraphicsItem *> _paintedItems; |