[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyKDE] weird PyQt bug: memory corruption?
From:       "Giovanni Bajo" <rasky () develer ! com>
Date:       2005-04-21 18:09:34
Message-ID: 04a601c5469d$45e62e50$bf03030a () trilan
[Download RAW message or body]

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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic