In my application I have a class that creates a widget with no parent and I want to destroy (call close() and it will automaticaly delete the object by seting the appropiate flag) when it looses the focus. The problem is that if I call the close function in the looseFocus event of the widget, the pointer in my creator class remains valid. I have seen the destroyed signal for QObject that I could use to invalidate the pointer once the widget has been destroyed. As this should be a normal use case I need to know if this is the correct approach to go.
1) loose focus
2) call close
3) wait for the destroyed signal in the creator class
4) invalidate the pointer in the creator class
Thanks
Ramiro
Bookmarks