about 7 years ago
In C++, need to import LIBS += -lbbsystem
QString text;
bb::system::Clipboard clipboard;
clipboard.clear();
QByteArray byte;
byte = text.toLocal8Bit();
clipboard.insert(“text/plain”,byte);
Remember, the Clipboard need insert QByteArray type.
We can define the String as QByteArray in order to use the Clipboard.
If you need to use some special characters, don't forget to use this line
byte = text.toLocal8Bit();
Here is the official API reference :)
http://developer.blackberry.com/cascades/reference/bb__system__clipboard.html