[PyKDE] PyQt QClipboard bugs.

James Grant jamesg at xtra.co.nz
Tue May 21 02:54:00 BST 2002


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.
-- 
James.




More information about the PyQt mailing list