[Qt-interest] Qt signaling smarts...

Gordon Schumacher gordon at rebit.com
Tue Nov 24 17:29:15 CET 2009


Scott Aron Bloom wrote:
> You will be covered.. Before a QObject derived class is destroyed, it
> emits a "destroyed()" signal, all objects connected to it, disconnect
> from it at that point.
>
> Note, if you are deleting in the middle of a event queue system blocking
> algorithm, call deleteLater, which will keep the pointer alive till the
> event system can delete it.
>   

In fact, I'd go so far as to say "don't delete a QObject, use
safeDelete() instead".  It's overstating it, but it'll save your hair
when you someday start using your shiny new class in a multi-threaded
application...



More information about the Qt-interest-old mailing list