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
Highlighted
Developer
Posts: 49
Registered: ‎11-11-2012
My Device: z10 LE
My Carrier: Digi

Access a 'global' instance (e.g. Label) from another class

Hi,

 

say there's a abc.cpp that's created a "Label *myLabel = root->findChild<Label*>("myLabelCObjName");" ,

 

what should be the approach to access his myLabel from another class (e.g. xyz.cpp) to setProperty, without referencing to the QML again?

 

thanks,
James Tan



James Tan
Eating my dog food - TripLogger, my 1st bb10 app.
Developer
Posts: 49
Registered: ‎11-11-2012
My Device: z10 LE
My Carrier: Digi

Re: Access a 'global' instance (e.g. Label) from another class

Got a working... ...

e.g. "Label *myLabel = bb::cascades::Application::instance()->findChild<Label*>("myLabelCObjName");" from the other cpp files.

Any other ways?



James Tan
Eating my dog food - TripLogger, my 1st bb10 app.