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
Contributor
binhpv
Posts: 20
Registered: ‎10-18-2012
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.

Please use plain text.
Developer
dishooom
Posts: 103
Registered: ‎12-31-2012
My Carrier: Verizon

Re: calling c++ function onCreationCompleted in qml

Please use plain text.
Contributor
binhpv
Posts: 20
Registered: ‎10-18-2012
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.
Please use plain text.