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
Contributor
Posts: 20
Registered: ‎10-18-2012
My Device: Cingular 8800
My Carrier: Viettel Telecom
Accepted Solution

calling c++ function onCreationCompleted in qml

I'm currently having s problem with calling c++ function from qml.

 

Normal calls works. But when I call a function in onCreationCompleted, it can't access qml object on the page.

 

For example:

 

Page{

 

onCreationComplete:

 

{ myFunction();}

 

Button{

 

ojbectName: "button1"

 

}

 

}

 

myFunction access button1 using findChild.

 

But this return 0x0, mean the button does not exist.

 

So how to access button1 in c++ when page is loaded?

 

i posted from a phone, so sorry if there's any mistake.

Developer
Posts: 103
Registered: ‎12-31-2012
My Device: Blackberry 9810
My Carrier: Verizon

Re: calling c++ function onCreationCompleted in qml

Highlighted
Contributor
Posts: 20
Registered: ‎10-18-2012
My Device: Cingular 8800
My Carrier: Viettel Telecom

Re: calling c++ function onCreationCompleted in qml

Look like we can't access to qml object when the page is creating( even we call it in onCreationCompleted). I worked around by calling the function after navigationpane.push.