Re: [PyQt] Regressions on destruction of objects?
FYI, with PyQt4 v4.6.1, the matplotlib's Qt4 backend is no longer usable interactively because the 'destroyed()' signal is not emitted when matplotlib's figure (QMainWindow instance) is closed (and destroyed, thanks to the Qt.WA_DeleteOnClose attribute). In other words, one can only show one figure with matplotlib/PyQt4 v4.6.1. Is there going to be a v4.6.2 release soon with this issue fixed? Thanks, Cheers, Pierre ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Regressions on destruction of objects?
On Sat, 07 Nov 2009 15:52:48 +0100, Pierre Raybaut cont...@pythonxy.com wrote: FYI, with PyQt4 v4.6.1, the matplotlib's Qt4 backend is no longer usable interactively because the 'destroyed()' signal is not emitted when matplotlib's figure (QMainWindow instance) is closed (and destroyed, thanks to the Qt.WA_DeleteOnClose attribute). In other words, one can only show one figure with matplotlib/PyQt4 v4.6.1. Is there going to be a v4.6.2 release soon with this issue fixed? I haven't yet decided if the next release is going to be v4.6.2 or v4.7. Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Regressions on destruction of objects?
On Thu, 29 Oct 2009 00:37:14 +0100, Giovanni Bajo ra...@develer.com wrote: On Wed, 28 Oct 2009 22:14:41 +, Phil Thompson p...@riverbankcomputing.co.uk wrote: On Wed, 28 Oct 2009 19:35:44 +0100, Giovanni Bajo ra...@develer.com wrote: Hi Phil, I'm testing PyQt 4.6.1 and SIP 4.9.1 over my small regression testsuite (it contains testcases for bugs that I have reported to you over the years and that you have fixed). There are 4 testcases failing with the new SIP/PyQt pair, but they all seem related to the same issue. Try this one: = #!/usr/bin/env python from PyQt4.Qt import * a = QObject(None) called = [] def myslot(): called.append(True) QObject.connect(a, SIGNAL(destroyed()), a, SIGNAL(QUIT())) QObject.connect(a, SIGNAL(destroyed()), myslot) QObject.connect(a, SIGNAL(QUIT()), myslot) del a assert len(called) == 2, len(called) = I would say this should work, right? Fixed in tonight's PyQt snapshot (and test added to the test suite). Can you send me the patch please? Attached. Phil--- PyQt/trunk/4/qpy/QtCore/qpycore_pyqtproxy.cpp (revision 2662) +++ PyQt/trunk/4/qpy/QtCore/qpycore_pyqtproxy.cpp (revision 2674) @@ -217,7 +217,10 @@ // by making the proxy a child of the transmitter. This doesn't work as // expected because QWidget destroys its children before emitting the -// destroyed signal.) +// destroyed signal.) We use a queued connection in case the proxy is also +// connected to the same signal and we want to make sure it has a chance +// to invoke the slot before being destroyed. if (qtx) -connect(qtx, SIGNAL(destroyed(QObject *)), SLOT(disable())); +connect(qtx, SIGNAL(destroyed(QObject *)), SLOT(disable()), +Qt::QueuedConnection); } ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] Regressions on destruction of objects?
Hi Phil, I'm testing PyQt 4.6.1 and SIP 4.9.1 over my small regression testsuite (it contains testcases for bugs that I have reported to you over the years and that you have fixed). There are 4 testcases failing with the new SIP/PyQt pair, but they all seem related to the same issue. Try this one: = #!/usr/bin/env python from PyQt4.Qt import * a = QObject(None) called = [] def myslot(): called.append(True) QObject.connect(a, SIGNAL(destroyed()), a, SIGNAL(QUIT())) QObject.connect(a, SIGNAL(destroyed()), myslot) QObject.connect(a, SIGNAL(QUIT()), myslot) del a assert len(called) == 2, len(called) = I would say this should work, right? -- Giovanni Bajo Develer S.r.l. http://www.develer.com ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Regressions on destruction of objects?
On Wed, 28 Oct 2009 19:35:44 +0100, Giovanni Bajo ra...@develer.com wrote: Hi Phil, I'm testing PyQt 4.6.1 and SIP 4.9.1 over my small regression testsuite (it contains testcases for bugs that I have reported to you over the years and that you have fixed). There are 4 testcases failing with the new SIP/PyQt pair, but they all seem related to the same issue. Try this one: = #!/usr/bin/env python from PyQt4.Qt import * a = QObject(None) called = [] def myslot(): called.append(True) QObject.connect(a, SIGNAL(destroyed()), a, SIGNAL(QUIT())) QObject.connect(a, SIGNAL(destroyed()), myslot) QObject.connect(a, SIGNAL(QUIT()), myslot) del a assert len(called) == 2, len(called) = I would say this should work, right? Fixed in tonight's PyQt snapshot (and test added to the test suite). Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Regressions on destruction of objects?
On Wed, 28 Oct 2009 22:14:41 +, Phil Thompson p...@riverbankcomputing.co.uk wrote: On Wed, 28 Oct 2009 19:35:44 +0100, Giovanni Bajo ra...@develer.com wrote: Hi Phil, I'm testing PyQt 4.6.1 and SIP 4.9.1 over my small regression testsuite (it contains testcases for bugs that I have reported to you over the years and that you have fixed). There are 4 testcases failing with the new SIP/PyQt pair, but they all seem related to the same issue. Try this one: = #!/usr/bin/env python from PyQt4.Qt import * a = QObject(None) called = [] def myslot(): called.append(True) QObject.connect(a, SIGNAL(destroyed()), a, SIGNAL(QUIT())) QObject.connect(a, SIGNAL(destroyed()), myslot) QObject.connect(a, SIGNAL(QUIT()), myslot) del a assert len(called) == 2, len(called) = I would say this should work, right? Fixed in tonight's PyQt snapshot (and test added to the test suite). Can you send me the patch please? -- Giovanni Bajo Develer S.r.l. http://www.develer.com ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt