Equivalent for closeEvent?

Chani chanika at gmail.com
Wed Jul 14 08:06:31 CEST 2010


On July 13, 2010 22:46:52 Nate C wrote:
> Is there any equivelent to QGraphicsWidget::closeEvent for a plasma
> applet. I need to shutdown a QThread on the close event, but can not
> figure anything out. Plasma::Applet subclasses QGraphicsWidget, so
> should I not get it for free? (I am using the python bindings.)

you mean when the applet is removed? well, it's destroyed then, so I assume 
making it the parent of the qthread would ensure the qthread is also 
destroyed...  ohhh, but "Note that deleting a QThread object will not stop the 
execution of the thread it represents" - so... in C++ I would have the 
applet's destructor stop the qthread (except, I can't remember if the 
qthread's destructor will have been called before or after that)...  
alternatively, there's the destroyed() signal. not sure which'd be easier in 
python.


More information about the Plasma-devel mailing list