On Wednesday 29 June 2005 3:21 pm, Giovanni Bajo wrote: > Phil Thompson <[EMAIL PROTECTED]> wrote: > > Yes - but they aren't in existence at the same time. > > [...] > > Using a temporary name to keep a reference to sv.viewport() solves the > > problem. > > Then you have the inverse problem: > > ---------------------------------------------- > from qt import * > > app = QApplication([]) > sv = QScrollView(None) > w = QWidget(sv.viewport()) > > p = w.parent() > print sv.viewport().width() > ---------------------------------------------- > Traceback (most recent call last): > File "D:\Work\caligola3d\src\pyqtbug3.py", line 9, in ? > print sv.viewport().width() > AttributeError: width > > which is wrong because viewport() is supposed to return a QWidget pointer.
It sees that it has already been wrapped (as a QObject) and just returns an extra reference. It doesn't try to retype the existing wrapper, or create a new wrapper to the same C++ instance with the more specific type. Phil _______________________________________________ PyKDE mailing list [email protected] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
