<br><br><div class="gmail_quote">On Sat, Feb 26, 2011 at 10:10 AM, Kun Zhang <span dir="ltr"><<a href="mailto:arthur.kun@gmail.com">arthur.kun@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br><br>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.<br>
<br>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.<br><br>I tried the following signals:<br>
connect(applet, SIGNAL("destroyed(QObject)"), self.onDestroy)<br>connect(applet, SIGNAL("appletDestroyed(Plasma.Applet)"), self.onDestroy)<br>but it seems the onDestroy() method is never triggered.<br clear="all">
<br>I also tried checking applet.isDestroyed() in the timer's handler, but it always returns false, thus helpless.<br><br>Does anybody has an idea?<br>-- <br>Best wishes<br><font color="#888888">ZHANG Kun<br>
</font></blockquote></div><br><br>Apologies. I found the correct signal signature should be in C++ style, despite that I'm using python. This signal connection works:<br><br>connect(applet, SIGNAL("appletDestroyed(Plasma::Applet*)"), self.onDestroy)<br>
<br clear="all"><br>-- <br>Best wishes<br>ZHANG Kun<br>