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

List:       pykde
Subject:    Re: [PyKDE] weird PyQt bug: memory corruption?
From:       Phil Thompson <phil () riverbankcomputing ! co ! uk>
Date:       2005-04-24 13:56:03
Message-ID: 200504241456.03552.phil () riverbankcomputing ! co ! uk
[Download RAW message or body]

On Thursday 21 April 2005 7:09 pm, Giovanni Bajo wrote:
> 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).

I see the same behaviour using the same versions. However with current 
snapshots the behaviour is as expected.

Phil

_______________________________________________
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