Thanks Thiago, that makes sense.
Cheers, frank On 27/03/17 7:48 PM, Thiago Macieira wrote:
On domingo, 26 de março de 2017 18:52:48 PDT Frank Rueter | OHUfx wrote:Hi, I'm pretty sure I'm misinterpreting how this should work so maybe you guys can help: I have a QObject which I would like to run a simple clean up job just before it's destroyed. I thought I could simply do this in it's constructor: self.destroyed.connect(self.__cleanUp) Then have self.__cleanUp() to the work. However, a simple print statement inside self.__cleanUp() shows that it's never run.I don't speak Python, so I am answering in terms of C++: QObject::destroyed() is emitted from QObject's own destructor. That means the object, at the time, *IS* a QObject and not your class. There is no slot called "__cleanUp" at that time anymore. destroyed() is useful for another QObject to perform some actions, not for the same object. If you need some actions to be performed at the time of destruction, just put them in your class's destructor.
_______________________________________________ Interest mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/interest
