Re: [PyQt] pyuic4 bug

2008-07-05 Thread Phil Thompson
On Sat, 05 Jul 2008 01:55:29 +0800, Iván García [EMAIL PROTECTED]
wrote:
 [EMAIL PROTECTED]:~/workspace/subdownloader/gui$ pyuic4 --version
 Python User Interface Compiler 4.4.3-snapshot-20080627 for Qt version
 4.4.0

Fixed in tonight's snapshot.

Thanks,
Phil

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Memory leak

2008-07-05 Thread Phil Thompson
On Thu, 03 Jul 2008 16:04:42 +0200, Giovanni Bajo [EMAIL PROTECTED]
wrote:
 Hi Phil,
 
 with SIP 4.7.6, PyQt 4.2.2, Qt 4.4.0:
 
 
 import sip
 import weakref
 from PyQt4.Qt import *
 
 class MyWidget(QWidget):
  def sizeHint(self):
  return QSize(900, 700)
 
 app = QApplication([])
 
 ws = MyWidget(None)
 wr = weakref.ref(ws)
 
 L = QVBoxLayout(None)
 L.addWidget(ws)
 L.activate()
 del L
 del ws
 
 import gc
 gc.collect()
 
 assert wr() is None
 
 
 The assert triggers, meaning that the object of type MyWidget is not 
 released.

This appears to be a Qt problem. Although the docs say that a layout takes
ownership of the widget when addWidget() is called it leaves the
destruction of the widget to the eventual owner of the layout and doesn't
call the widget's dtor itself.

If the layout is never used (ie. never passed as an argument to
QWidget.setLayout()) then all the widgets in the layout will leak.

An equivalent C++ version behaves in the same way.

I could change addWidget() so that the layout doesn't take ownership of the
widget (ie. to match the implementation rather than the documentation) but
that will break any code that creates a populated layout and returns it
from a function.

Phil

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] core dump in pyqt application

2008-07-05 Thread Iván García

One of my users just reported this bug:

ASSERT failure in QCoreApplication::sendEvent: Cannot send events to objects owned 
by a different thread. Current thread f74470. Receiver 'MainWindow' (of type 
'QMainWindow') was created in thread 9a7fc0, file kernel/qcoreapplication.cpp, line 
269
Cancelado (core dumped)

How to avoid this problem? Is there a way to fix the problem within the 
application code?


Thanks in advance.
Ivan.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt