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: 20
Registered: ‎07-14-2012
My Device: Dev Alpha , Curev 9300
My Carrier: Vodafonee
Accepted Solution

Invoking C++ Fuctions from qml button

Button *newButton = root->findChild<Button*>("eat");
connect(newButton,SIGNAL(Button::clicked()),this,SLOT(ont()));

 

 

Developer
Posts: 96
Registered: ‎10-06-2012
My Device: Z10
My Carrier: Rogers

Re: Invoking C++ Fuctions from qml button

You may need to provide a little more information for anyone to determine what's wrong. But try the link below, it has good examples of C++ / QML integration and then ask your question based on that, with more details

https://developer.blackberry.com/cascades/documentation/dev/integrating_cpp_qml/index.html
Jason I. Carter
Follow me @jasonicarter
Built For BlackBerry - WordsPlus & WordsPlus: Free Edition | word search has never had it so good
www.twocasualcoders.com | never casual on quality
Highlighted
Developer
Posts: 262
Registered: ‎07-13-2012
My Device: PlayBook, DA B, DA C, LE Z10 #102, Q10, Z30
My Carrier: T-Mobile

Re: Invoking C++ Fuctions from qml button

Not quite sure what you are trying to show with the code you have pasted, however based off the title of the thread to invoke a C++ function from something in QML doesn't require you to do anything on the C++ side except write the function. Then in the header file you declare the function.  Finally in the QML you do the actual invoking.

 

This example has a basic C++ function being called to do a calculation based off some QML inputs and a signal: http://bbcascadescode.tumblr.com/post/29294239402/running-c-function-from-qml-trivial-example

---
Check out my BB10 Cascades Coding site: BBcascades.com & Cascades Blog: bbcascadescode.tumblr.com

My Built for BlackBerry app: The Dive Plan