[PyKDE] PyQt QClipboard bugs.
Phil Thompson
phil at river-bank.demon.co.uk
Sat Jun 22 03:09:01 BST 2002
James Grant wrote:
> Hi,
>
> Firstly, this piece of code in qclipboard.sip needs to change from:
> void setData(QMimeSource *);
> to this:
> void setData(QMimeSource * /Transfer/);
> Otherwise you get messages like this all the time from Qt:
> QMimeSource::~QMimeSource: clipboard data deleted!
> Because you're deleting the clipboard when you shouldn't be.
>
> Secondly, when you call the data() method of QClipboard you get a QMimeSource
> object returned. But the problem with this is that this class contains pure
> virtual methods in C++, such as encodedData(QString):
> QByteArray QMimeSource::encodedData ( const char * ) const [pure virtual]
>
> which means we end up with errors like this in python:
> dataStr = str(data.encodedData("application/x-blah"))
> AttributeError: encodedData
>
> My guess is that the data() method of QClipboard should be returning an object
> of the actual type, i.e. QStoredDrag.
Fixed in the latest snapshot.
Phil
More information about the PyQt
mailing list