[PyKDE] bug in pyqt or in example?

Phil Thompson phil at riverbankcomputing.co.uk
Thu Nov 30 22:14:39 GMT 2006


On Thursday 30 November 2006 5:24 pm, Ulrich Berning wrote:
> Phil Thompson wrote:
> >On Thursday 30 November 2006 11:02 am, mancausoft wrote:
> >>Phil Thompson <phil at riverbankcomputing.co.uk> scrisse:
> >>>Can you try with tonight's SIP and PyQt4 snapshots? (Not the current
> >>>PyQt snapshot - the one that will be generated tonight.)Can you try
> >>
> >>the result it the same
> >>
> >> ~/PyQt-x11-gpl-4-snapshot-20061129/examples/draganddrop/draggableicons
> >>$ ./draggableicons.py Segmentation fault
> >
> >Can you find where it's crashing with gdb?
> >
> >Can anybody else reproduce the problem?
>
> I have tried it with Python-2.5, Qt-4.2.1, sip-snapshot-20061126,
> PyQt-4-snapshot-20061129. On all platforms, drag move actions work as
> expected, but drag copy actions show a wrong behavior (compared to the
> behavior of the Qt example): After starting a drag copy action, the icon
> is grayed at the old position. After a drop, the gray icon should
> disappear and the normal icon should appear again, but the grayed icon
> remains. Sooner or later, the application crashes on most platforms.
>
> On Linux (SuSE 9.2) it crashes.
> On Solaris it crashes.
> On AIX it crashes.
> On HP-UX it doesn't crash.
> On IRIX it crashes.
> On Windows it doesn't crash.
>
> After applying the changes suggested by Mancausoft, everything works as
> expected. If these changes make no sense Phil, there must be something
> wrong with PyQt or SIP.

No, I was confused because I was assuming that the code was a correct port of 
the original C++. The correct fix is to replace...

    pixmap = child.pixmap()

...with...

    pixmap = QtGui.QPixmap(child.pixmap())

...which is the equivalent of what the C++ code does.

I won't embarrass myself by explaining why I couldn't reproduce the problem.

Thanks everyone,
Phil




More information about the PyQt mailing list