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
New Contributor
iOsBoy
Posts: 7
Registered: ‎05-09-2013
My Device: Blackberry z10

Can't modify qml component from c++

I am trying to modify the text of button using my c++ code but for some reason nothing happens.My complete code is pasted at this location http://stackoverflow.com/questions/16646572/cant-change-the-value-of-qml-component-from-c  .I am a newbie to BB development so anyone please help me.

Developer
Zmey
Posts: 1,512
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: Can't modify qml component from c++

This doesn't seem like Momentics-generated code. Why aren't you using QmlDocument class and createRootObject function?

This thread has an example:

http://supportforums.blackberry.com/t5/Cascades-Development/findChild-not-working/m-p/2235787#M17154

Btw, I suspect that wizard-generated code is actually residing in Popop class

new Popop(&app);

 and you're creating a second QML instance in main() then working with that second instance which isn't used after that, so the changes aren't appearing.

 


Andrey Fidrya, @zmeyc on twitter