[PyKDE] Qt4 QClipboard & QMimeData problem

Doug Bell dougb at bellz.org
Mon Sep 4 17:57:20 BST 2006


Hi,

I'm having another problem with QClipboard, this time when using
QMimeData.  I don't know whether there is any connection between this
and my previously reported (and still unsolved) problem with the
QClipboard.dataChanged() signal.

The current issue is that QClipboard does not seem to take proper
ownership of the data in QMimeData.  It causes segmentation faults in
Linux when trying to paste the data.

But the convenience function QClipboard.setText() works fine.  Since it
just uses QMimeData in the Qt source, this appears to be a PyQt bug.

If I keep a Python reference to the QMimeData instance, then the paste
works fine.  But even this sometimes segfaults on program exit
(strangely, my simple example segfaults on exit but my larger program
does not).

Also, I've had no problems with QDrag.setMimeData(), so this appears to
be an isolated issue.

A simple example that illustrates the problem is attached.  Just click
the "Copy" button, then the "Paste" button.

I'm using Debian packages for Qt 4.1.4 and PyQt 4.0.1.

Thanks,
Doug.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tst.py
Type: text/x-python
Size: 1341 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20060904/4f694e1f/tst.py


More information about the PyQt mailing list