Problems about plasmoid's destroy event
arthur.kun at gmail.com
Sat Feb 26 03:38:11 CET 2011
On Sat, Feb 26, 2011 at 10:10 AM, Kun Zhang <arthur.kun at gmail.com> wrote:
> 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
> 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
Apologies. I found the correct signal signature should be in C++ style,
despite that I'm using python. This signal connection works:
connect(applet, SIGNAL("appletDestroyed(Plasma::Applet*)"), self.onDestroy)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Plasma-devel