Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
Posts: 75
Registered: ‎08-15-2013
My Device: blackberry curve 9630
My Carrier: Airtel

Blackberry Cascades Clipboard Usage

Hi All,

 

I want to write a piece of code which can copy text from text field and copy that text into clipboard which can be pasted later on into any application.

 

I am using blackberry cascades (API level 10.0) for development. in QNX momentics IDE.

 

For clipboard i used following api :-

 

https://developer.blackberry.com/native/reference/cascades/bb__system__clipboard.html

 

But what i find is that this is not being recognized by the compiler and showing as compile error.

 

Please help me how will i be able to fullfill my requirement. Alsp please share any code sample.snippet where clipboard copy paste is implemented. That will be very helpful.

 

Thanks & Regards,

Tushar

Developer
Posts: 543
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: Telekom Slovakia

Re: Blackberry Cascades Clipboard Usage

[ Edited ]

One suggestion at start:
After you add any new library to the project, clean it and rebuild again.
And here is working code for copy and paste text in my app:
Copy text:

Clipboard clip:
clip.clear();
bool success = clip.insert("text/plain", "your text");

Get copied text:

Clipboard clip;
QByteArray data = clip.value("text/plain");


If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Blackberry Cascades Clipboard Usage

Hi,

 

Can you show your compiler/linking error?

 

eg: Did you add the library to your .pro file?

 

Thank you.

--
Rob is no longer associated with BlackBerry.