- 
    Bug 
- 
    Resolution: Done
- 
    P2: Important 
- 
    5.6.1, 5.7.0
- 
    Windows
- 
        
- 
        1d09b0d1b28eaea17069f7359956640f31ea79c6 (qtbase/5.12, 28.9.2018, 5.12b1)
When QGraphicsItem (QGraphicsTextItem in this scenario) is part of a QGraphicsScene, but the scene is not attached to a view, modifying the Item's geometry, contents or anything that requires redraw, increases memory consumption.
This is caused by line:
d->updatedRects << rect; (QGraphicsScene.cpp@3198)
In this specific use-case, the scene may never be attached to a view, so the updatedRects QList is never cleared.
Steps to reproduce:
- Run attached sample
- Observe memory usage
- EXPECTED: Memory usage does not increase at such high rate (if at all)
- ACTUAL: Memory usage increases a lot indefinitely
| For Gerrit Dashboard: QTBUG-54275 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V | 
| 163668,5 | QGraphicsScene::update(): Keep the list of updatedRects() unique | dev | qt/qtbase | Status: ABANDONED | +2 | 0 | 
| 241098,2 | QGraphicsScene::update(): Keep the list of updatedRects() unique | 5.12 | qt/qtbase | Status: MERGED | +2 | 0 | 
| 273834,5 | Add a benchmark for QGraphicsScene::update() | 5.13 | qt/qtbase | Status: ABANDONED | -1 | 0 |