From pykde Thu Apr 21 18:09:34 2005 From: "Giovanni Bajo" Date: Thu, 21 Apr 2005 18:09:34 +0000 To: pykde Subject: [PyKDE] weird PyQt bug: memory corruption? Message-Id: <04a601c5469d$45e62e50$bf03030a () trilan> X-MARC-Message: https://marc.info/?l=pykde&m=111410709616701 Hello, I have found a very weird bug with PyQt, which might be some sort of memory corruption thus hard to reproduce. I'm using Qt 3.3.4, PyQt 3.14.1, SIP 4.2.1, under Windows. This is the minimal snippet (took me two hours to reduce it...): ------------------------------------------------------ from qt import * class W1(QWidget): def __init__(self): QWidget.__init__(self, None) QComboBox(self) self.queryList("") self.sizeHint() app = QApplication([]) W1() print QScrollView(None).viewport().className() print QScrollView(None).viewport().className() print QScrollView(None).viewport().className() print QScrollView(None).viewport().className() print QScrollView(None).viewport().className() print QScrollView(None).viewport().className() ------------------------------------------------------ which prints: ------------------------------------------------------ QWidget QObject QWidget QObject QWidget QObject QWidget QObject ------------------------------------------------------ which is of course totally weird. Notice the weird things you have to do in that widget constructor to reproduce this. Commenting every line in the above testcase causes the bug to disappear. It is also very sensitive to order of operations. Can anybody reproduce this? Phil, do you have any idea about what might be causing this? What happens in my full application is an AttributeError while trying to call QScrollView.viewport().setBackgroundMode, because the name does not exit (the object is a QObject instead of a QWidget). -- Giovanni Bajo _______________________________________________ PyKDE mailing list PyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde