[PySide] Very slow items removing from QGraphicsScene

Evgeny Prilepin esp.home at gmail.com
Fri Mar 28 23:17:57 CET 2014


Hi all,

I tested the removing graphic items on PyQt4 and C++ Qt4. It works 
correctly. The time for the removing items not increases exponentially. 
I think, PySide contains a bug with the garbage collection or something 
similar.


> Hi everyone,
>
> My program should work with a great number of graphic items in the
> graphic scene QGraphicsScene. There are hundred thousand homogeneous
> items similar to QGraphicsRectItem. The items can be removed or added at
> the runtime. All the items sometimes are removed from the scene.
>
> I have noticed that if I want to remove all the items from the scene
> using “clear” method or in the loop using “removeItem” method (“clear”
> works much longer), I have to wait for a long time the operation
> completing, if the cleaning is used not for the first time. In this
> case, the item removing, unlike the element adding that is always the
> same, is extremely slow. Such a situation occurs when there are more
> than several thousand items (more than 10 000). The time for the
> removing items increases exponentially (see the pictures with the
> attached plots). Also I have written a simple test example (please, find
> the attached example), demonstrating this problem.
>
> At present I use PySide, version 1.2.1 (Qt 4.8.5) and Python 2.7.6
> x86/x64 on OS Windows 7 x64.
>
> CPU: Intel Core 2 Quad 6600
> RAM: 6 Gb
>
> --
> Best regards,
> Evgeny

-- 
Best regards,
Evgeny



More information about the PySide mailing list