[PyKDE] Segfault in QGraphicsScene.drawItems
Arve Knudsen
arve.knudsen at gmail.com
Fri Feb 23 19:45:01 GMT 2007
Thanks Phil. I've tried to make sense of how to make sip convert between the
two (array<->list), but give up (I've never learnt sip). I'll leave this to
the expert ...
Arve
On 2/23/07, Phil Thompson <phil at riverbankcomputing.co.uk> wrote:
>
> On Friday 23 February 2007 7:04 pm, Arve Knudsen wrote:
> > On 2/23/07, Michael Guntsche <mike at it-loops.com> wrote:
> > > On Feb 23, 2007, at 17:51, Arve Knudsen wrote:
> > > > Hello
> > > > If I try to reimplement the method drawItems in a QGraphicsScene
> > > > subclass, the program segfaults. Is this a bug in PyQt? I am by the
> > > > way using PyQt 4.1.1 (self-compiled) and Qt 4.2.0 (Ubuntu). I've
> > > > included a sample program which exhibits the behaviour.
> > >
> > > Works here.
> > > QT 4.2.2 and the latest Pyqt snapshot.
> >
> > Very strange ... I've now installed the latest snapshot, and the problem
> > persists. This time on a Gentoo installation with Qt 4.2.2. Inspecting
> the
> > generated Python bindings, sipQtGuiQGraphicsScene.cpp, it seems to me
> there
> > is a bug in meth_QGraphicsScene_drawItems. Argument 3, an array of
> > QGraphicsItem*, is actually treated as a return value from the
> > corresponding C++ function and thus uninitialized before being passed to
> > Qt. As such I wonder how come it doesn't crash on your machine, maybe
> the
> > memory error is not detected?
> >
> > If you print out the arguments to drawItems in Python you'll find that
> > instead of a list of QGraphicItems you'll receive an int instead (the
> > number of items).
>
> It's a bug - I need to add some handwritten code to handle the array.
>
> Phil
>
> _______________________________________________
> PyKDE mailing list PyKDE at mats.imk.fraunhofer.de
> http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20070223/f6fb499c/attachment.html
More information about the PyQt
mailing list