[PyKDE] weird PyQt bug: memory corruption?

Giovanni Bajo rasky at develer.com
Thu Apr 28 14:18:26 BST 2005

Ümit Öztosun <umit.oztosun at gmail.com> wrote:

>> 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).
> Hi,
> Although I am unable to reproduce the problem, a while ago I had
> similar problems. I was getting AttributeErrors in a QTable derived
> custom widget. For example code similar to:
> self.verticalHeader().setResizeEnabled(False, 0)
> in that QTable derived widget sometimes failed with AttributeErrors.
> When I examined self.verticalHeader(), I found that it was a QObject
> instead of QHeader.

Yes, this is exactly the same problem, but in a different context.

> However, this occurred rarely, and dissappeared
> after I changed the way I use queryList().
> Prior to PyQt 3.14.1 (including PyQt 3.14) this problem never
> occurred. I observed it only in PyQt 3.14.1 and later snapshots.
> Although I tried, I couldn't produce a sample script which
> demonstrates the problem.

This could in fact be related to queryList() somehow. Notice that queryList
was first modified in PyQt 3.14 to add support for Python types. Also,
queryList() was recently modified for a bugfix (it was leaking objects),
which might be the change which hides this bug in the current PyQt snapshot.
Giovanni Bajo

More information about the PyQt mailing list