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
Developer
Posts: 179
Registered: ‎07-19-2012
My Device: Z10 Limited Edition and Dev Alpha C
My Carrier: Movistar-Venezuela

How Used Clipboard? [QML]

Hi, I was using the following command to copy the label information

 

 

IMG_00000006.png

 

              Label {
              id: myTextArea
              text: _hardware.deviceName
              textStyle.fontSize: FontSize.PointValue
              textStyle.fontSizeValue: 8.5
              textStyle.color: Color.White
              horizontalAlignment: HorizontalAlignment.Right
contextActions: [
ActionSet {	
ActionItem {
title: "Copy"
onTriggered: {

}
}
]                                            

 But in the action "onTriggered" that command is not to copy the text of my label. Whoever helps me complete this? Greetings.

 

 


Follow me in Twitter:

@Marcossit

BBM Channel:

MarcossitDev: C0002C366  

DeviceSuite For BlackBerry 10:

Link to Download DeviceSuite:

Support was successful? Accept as Solution and click on:


New Developer
Posts: 13
Registered: ‎08-03-2013
My Device: Blackberry Z10 - Q10 - Q5
My Carrier: UAE Du

Re: How Used Clipboard? [QML]

Read this documentaion :

 

Clipboard - Cascades™ for BlackBerry 10

 

These Posts:

 

Clipboard

 

Clipboard - Insert Utf8/Unicode characters to clipboard

 

As you can see, you will have to edit .pro, .hpp & .cpp files to access Clipboard!

 

Good Luck.

Developer
Posts: 83
Registered: ‎06-20-2013
My Device: Blackberry 10
My Carrier: idea

Re: How Used Clipboard? [QML]

Use a cpp function for this,and make that function invokable

void App::copytext(QByteArray text)
{
	bb::system::Clipboard clipboard;
	clipboard.clear();
	clipboard.insert("text/plain", text);
	bb::system::SystemToast *toast = new SystemToast(this);
	toast->setBody("Value copied to clipboard.");
	toast->show();
}

 now call this function in onTriggered like this

app.copytext("abc")

 and u are done...:smileyhappy:

 


Did this post help you? If so, please make sure to "like" it!