[PyQt] Re: How do I intercept widget destruction?

Matt Newell newellm at blur.com
Wed Oct 22 18:29:16 BST 2008


On Wednesday 22 October 2008 09:49:58 Jeremy Sanders wrote:
> Matt Newell wrote:
> > If you subclass you can override QWidget.closeEvent, QWidget.hideEvent,
> > or the destructor.
>
> Thanks - I tried to override closeEvent but it never seems to get called.
> Is there some trick? This is for a QLineEdit.
>
> Jeremy

close events are only delivered to top level windows.  You either need to use 
hideEvent on the line edit, or closeEvent on it's window().

Matt


More information about the PyQt mailing list