Problems about plasmoid's destroy event

Kun Zhang arthur.kun at gmail.com
Sat Feb 26 03:10:09 CET 2011


Hi,

I'm writing a plasmoid with Python. I have a QTimer to do refresh stuff and
it works fine, unless I remove the plasmoid from desktop and the timer's
access to applet.isUnderMouse() will cause the whole plasma desktop to
crash.

I have confirmed that plasma won't crash if I don't start the timer, so I
think if I could stop the timer before the plasmoid is being destroyed, the
crash can be prevented.

I tried the following signals:
connect(applet, SIGNAL("destroyed(QObject)"), self.onDestroy)
connect(applet, SIGNAL("appletDestroyed(Plasma.Applet)"), self.onDestroy)
but it seems the onDestroy() method is never triggered.

I also tried checking applet.isDestroyed() in the timer's handler, but it
always returns false, thus helpless.

Does anybody has an idea?
-- 
Best wishes
ZHANG Kun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/plasma-devel/attachments/20110226/68bd7701/attachment.htm 


More information about the Plasma-devel mailing list