Hi, We've been working on making sure that our application works with the latest versions of Qt, SIP and PyQt (3.3.2, 4.0 and 3.12, respectively.) Doing that, we've come across a problem with QWidgetFactory.
Something seems to happen to ownership of the widget returned by QWidgetFactory.create(). If one doesn't keep a reference to the widget it gets destroyed immediately, even if it is given a parent widget. At first I thought that maybe it was intentional (even though it doesn't work that way in older versions) but if we do keep a reference to the widget throughout its life, the program seg faults when the reference is cleaned up. In our application we use our own, subclassed widget factory to create special widgets, but I wrote a simple example using the built-in widget factory to demonstrate the behavior. The example is attached to this mail, along with a trivial .ui-file defining a widget with a QLineEdit and a QPushButton in a QVBoxLayout. The example code displays the behavior when not keeping a reference, but by commenting the chunk of code marked with 1. and de-commenting the chunk marked 2. the widget gets displayed but the app segfaults when it's about to exit. Any help on this matter would be much appreciated! //Fredrik
test.py
Description: application/python
form1.ui
Description: application/designer
