diff options
author | Andre de la Rocha <andre.rocha@qt.io> | 2019-09-02 16:46:07 +0200 |
---|---|---|
committer | Andre de la Rocha <andre.rocha@qt.io> | 2019-10-11 16:53:23 +0200 |
commit | 31012df705c37503be00f0ddc2c323e73fd28067 (patch) | |
tree | b75d19c181e1ba874cb0f421c729ba3d8f07d78b /tests | |
parent | 014d7ac65417ed9b5ffb85cca24d16564ff5005a (diff) |
Fix QGraphicsScene::update() performance
A previous fix has caused a performance degradation while adding a
check for avoiding adding duplicated rectangles to the update list.
This patch fixes it by using a std::set instead of a QList, avoiding
duplication while using an O(log N) operation, instead of the O(N)
used before.
Fixes: QTBUG-77952
Change-Id: Ifa9fbf110e0bad60ee02a42d91281981fd98ceab
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp index 46f1d5df5c..4f8741a5aa 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp @@ -3685,8 +3685,6 @@ void tst_QGraphicsScene::changedSignal() qApp->processEvents(); QCOMPARE(cl.changes.size(), 2); QCOMPARE(cl.changes.at(1).size(), 2); - QCOMPARE(cl.changes.at(1).first(), QRectF(0, 0, 10, 10)); - QCOMPARE(cl.changes.at(1).last(), QRectF(20, 0, 10, 10)); QCOMPARE(scene.sceneRect(), QRectF(0, 0, 30, 10)); |