This forum has been archived. All content is frozen. Please use KDE Discuss instead.

kclipboard/qclipboard that keeps the "copied" contents

Tags: None
(comma "," separated)
deadeyes
Registered Member
Posts
34
Karma
0
Hi all,

I want to have a button in my application that copies a string to the clipboard.

I found an example using qclipboard and within a minute I had it working.
however not fully as expected.
The contents that are copied to the clipboard are only there until you close the qt application.

Now I wondered how I can solve this. I found out there is also a kde specific class: kclipboard.
However there is no documentation (do note that I am not used to program in C++/qt/kde so excuse me for my ignorance).
Can someone give me an example and if that fixes my issue?

Thanks in advance!
pinotree
KDE Developer
Posts
222
Karma
7
OS
I remember the fact that closing an application empies the clipboard as an X11 peculiarity (so nothing you can fix).
There's no such "KClipboard"; the most closer thing is an internal class KClipboardSynchronizer, but that does not do what you want (just synchronizes the clibpoard and the X11 selection).


Pino Toscano
deadeyes
Registered Member
Posts
34
Karma
0
pinotree wrote:I remember the fact that closing an application empies the clipboard as an X11 peculiarity (so nothing you can fix).
There's no such "KClipboard"; the most closer thing is an internal class KClipboardSynchronizer, but that does not do what you want (just synchronizes the clibpoard and the X11 selection).


http://api.kde.org/4.5-api/kdelibs-apid ... _8cpp.html ;)
So there seems to be a class.
But as I don't have any experience with it I believe what you say :)

Thanks for taking your time to answer my question.
pinotree
KDE Developer
Posts
222
Karma
7
OS
deadeyes wrote:http://api.kde.org/4.5-api/kdelibs-apidocs/kdeui/html/kclipboard_8cpp.html ;)
So there seems to be a class.

No, this is just the source file containing the internal, unrelated, class I mentioned above:
http://websvn.kde.org/trunk/KDE/kdelibs ... iew=markup


Pino Toscano


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft