PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 1115 - can't use an instancemethod to receive QObject 'destroyed' signal
: can't use an instancemethod to receive QObject 'destroyed' signal
Status: RESOLVED INVALID
Product: PySide
Classification: Unclassified
Component: QtCore
: HEAD
: PC Linux
: P5 normal
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2012-01-09 04:55 EET by Jelle Geerts
Modified: 2012-01-09 16:57 EET (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jelle Geerts 2012-01-09 04:55:46 EET
If one wants to connect to the QObject 'destroyed' signal, it seems one can't
use an instance method. One instead needs to use a @staticmethod or
@classmethod (or lambda, etc.).

See the attached 'example.py'.
Comment 1 Jelle Geerts 2012-01-09 16:57:16 EET
In C++, Qt behaves the same, it just fails silently when using an instance
method of the same object that is destroyed after the 'destroyed' signal is
emitted.

It makes sense when reading the Qt source code, since the signal is emitted at
the very end in the QObject destructor.