06-19-2012 05:08 PM
Will there be clipboard support? I would like to read/write to the cut and paste buffer. A user could then for instance select text in any app, then start my app, which would process that text, and put the result back on the clipboard. Or it could put an image on the clipboard that the user could then use in another app.
Solved! Go to Solution.
06-28-2012 11:12 AM
Hey there,
Unfortunately this is not yet currently supported;
Martin
07-01-2012 12:28 PM
For a more useful answer, I'll ammend that by saying that the Qt-friendly BB10 APIs do not currently provide Clipboard support, and I'm not sure if Qt's own clipboard APIs are working on BB10 yet.
However... QNX itself does have a clipboard API, and it does actually work. For a very brief example, here's how you take a QString and stick it in the clipboard:
#include <clipboard/clipboard.h>
void copyText(QString text) {
if(empty_clipboard() == 0) {
QByteArray data = text.toUtf8();
set_clipboard_data("text/plain", data.size(), data);
}
}
I suggest spending some time investigating clipboard.h for additional documentation on what you can use it for.
07-01-2012 01:40 PM
Thanks! That's what I was looking for. And do you happen to know which library I should link against?
07-01-2012 01:43 PM
Oh yeah, the one bit I forgot :-)
Its (quite obviously) named libclipboard.
So I added "LIBS += -lclipboard" to my project's .pro file.
07-02-2012 01:22 AM
Thanks for sharing this! ![]()
10-09-2012 04:10 PM - edited 10-09-2012 04:11 PM
This solution is not very well working. My app is at example only able to read the clipboard data while it is in the foreground and there is no Signal emittet if there are changes.
Polling the clipboard to watch for changes is not a very good solution, too. ![]()
Are there any kind of information when QClipboard will get supported?