Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Purge Cache of QGraphicsItem
Asperamanca last edited by
When using QGraphicsItem's cacheMode "DeviceCoordinateCache", I get some painting issues in a very specific case (combining of painting via QGraphicsView and QGraphicsScene::render).
A simple solution would be to purge the cache of all items within the scene just before calling QGraphicsScene::render.
I found an internal QGraphicsItemCache::purge(), but no way to invoke it from outside.
One way to invoke it indirectly is to remember the cache mode, set it to NoCache, and set it back to the original cache mode. My headache for this is how to obtain the logicalCacheSize for those items with ItemCoordinateCache, so I can restore the original size.