Thank you guys for your help!

The strangest thing was that for some object the pointer became null, and for other not. I googled a lot but i wasn't able to understand what was happening. Using a QPointer everything works perfectly!