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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
New Developer
arjunhemrajani
Posts: 20
Registered: ‎07-14-2012
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()));

 

 

Please use plain text.
Developer
jaiaca
Posts: 90
Registered: ‎10-06-2012
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 | word search has never had it so good
www.twocasualcoders.com | never casual on quality
Please use plain text.
Developer
bcs925
Posts: 212
Registered: ‎07-13-2012
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
Please use plain text.