Reading the clipboard from a KIO slave

David Faure faure at kde.org
Fri Jul 2 16:54:18 BST 2004


On Friday 02 July 2004 14:52, Oliver Stieber wrote:
> Hi,
>    I'm trying to write a KioSlave to for the
> clipboard.
> 
> QApplication::clipboard() returns a valid object and I
> can call things like supportsSelection() without any
> problems.
> But as soon as I try to get or set any data from the
> clipboard I get an exception.
> 
> I assume this is because my KIOSlave doesn't get
> loaded like a normal application and so
> QApplication::clipboard() isn't initilized properly.
> 
> Any ideas of how I can initilize
> QApplication::clipboard() or get hold of the clipboard
> (possibly use an external application and dcop, hmm
> nasty).

Instanciate a KApplication in the kioslave instead of just a KInstance.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list