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 ...<br><br>Arve<br><br><div><span class="gmail_quote">
On 2/23/07, <b class="gmail_sendername">Phil Thompson</b> <<a href="mailto:phil@riverbankcomputing.co.uk">phil@riverbankcomputing.co.uk</a>> wrote:</span><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
On Friday 23 February 2007 7:04 pm, Arve Knudsen wrote:<br>> On 2/23/07, Michael Guntsche <<a href="mailto:mike@it-loops.com">mike@it-loops.com</a>> wrote:<br>> > On Feb 23, 2007, at 17:51, Arve Knudsen wrote:
<br>> > > Hello<br>> > > If I try to reimplement the method drawItems in a QGraphicsScene<br>> > > subclass, the program segfaults. Is this a bug in PyQt? I am by the<br>> > > way using PyQt
4.1.1 (self-compiled) and Qt 4.2.0 (Ubuntu). I've<br>> > > included a sample program which exhibits the behaviour.<br>> ><br>> > Works here.<br>> > QT 4.2.2 and the latest Pyqt snapshot.<br>
><br>> Very strange ... I've now installed the latest snapshot, and the problem<br>> persists. This time on a Gentoo installation with Qt 4.2.2. Inspecting the<br>> generated Python bindings, sipQtGuiQGraphicsScene.cpp
, it seems to me there<br>> is a bug in meth_QGraphicsScene_drawItems. Argument 3, an array of<br>> QGraphicsItem*, is actually treated as a return value from the<br>> corresponding C++ function and thus uninitialized before being passed to
<br>> Qt. As such I wonder how come it doesn't crash on your machine, maybe the<br>> memory error is not detected?<br>><br>> If you print out the arguments to drawItems in Python you'll find that<br>> instead of a list of QGraphicItems you'll receive an int instead (the
<br>> number of items).<br><br>It's a bug - I need to add some handwritten code to handle the array.<br><br>Phil<br><br>_______________________________________________<br>PyKDE mailing list <a href="mailto:PyKDE@mats.imk.fraunhofer.de">
PyKDE@mats.imk.fraunhofer.de</a><br><a href="http://mats.imk.fraunhofer.de/mailman/listinfo/pykde">http://mats.imk.fraunhofer.de/mailman/listinfo/pykde</a><br></blockquote></div><br>