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
Developer
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Re: settext doesnt work when label is in second page of navigation pane

I have done exactly same. Changed method parameter 

 

ApplicationUI::callmethod(Page *page) but when I call it from qml its giving me  error " Error: Unknown method parameter type: Page*"

Rujuta Trivedi
Developer
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Re: settext doesnt work when label is in second page of navigation pane

Done it

 

void ApplicationUI::callmethod(QObject *page){

Page* pg = dynamic_cast<Page *>(page);

  lbl = pg->findChild<Label*>("lbl");

  lbl->setText("text");

  

}

 

Needed to cast it.Thanks a ton for helping me out

Rujuta Trivedi
Developer
Posts: 1,523
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: settext doesnt work when label is in second page of navigation pane

Glad you got it working, but casting as QObject is an unnecessary step.

 

I'm 100% sure the code I given is working, please check the attached project with these modifications.

 


Andrey Fidrya, @zmeyc on twitter