[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] How to delete QCanvasItems?
From:       Solly Brown <sollyb () cse ! unsw ! edu ! au>
Date:       2004-11-25 23:14:55
Message-ID: Pine.LNX.4.61.0411261011380.11721 () serpent ! orchestra ! cse ! unsw ! EDU ! AU
[Download RAW message or body]

Roberto,

I haven't tried it myself, but the following should work:

myCanvasItem.setCanvas(None)

I assume you're having problems getting rid of the python object because 
it is still owned by the canvas it was on. If you remove it from the 
parent canvas before you try to delete it you may have more luck.

Cheers, Solly


On Thu, 25 Nov 2004, Roberto Alsina wrote:

> A friend and I are working on an application that creates QCanvasItems.
> That's ok.
>
> But it should also delete them sometimes. And I just can't see how?
>
> If I delete the python object, it doesn't seem to go away. At least
> canvas.allItems() still counts them.
>
> Is there a way to force deletion of the C++ object at least? It would
> still leak some memory on the python side, but it would be somewhat
> better.
>
> If q QCanvasItem was a QObject I would call deleteLater, but it isn't.
>
>
> -- 
> ("\''/").__..-''"`-. .         Roberto Alsina
> `9_ 9  )   `-. (    ).`-._.`)  ralsina@kde.org
> (_Y_.)' ._   ) `._`.  " -.-'   KDE Developer (MFCH)
>  _..`-'_..-_/ /-'_.'
> (l)-'' ((i).' ((!.'             Buenos Aires - Argentina
> Imminentizing the eschaton since 1971.
>
> _______________________________________________
> PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
> http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
>

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic