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

Posts: 163
Registered: ‎04-28-2012
My Device: BlackBerry 9800
My Carrier: BlackBerry

Can't find variable: app while calling a cpp method from QML..?



     I am getting a problem while calling a method from qml.


The problem is 

I have two qml files(a.qml,b.qml) and one custom component say leftmenu.I have used that customcomponent from both the qml files.In the a.qml ,when i click on left menu i am calling a c++ method and it will push b.qml.This is working fine.

After pushing the second screen when i click on the same leftmenu the method is not calling and showing an error can't find variable:

And i have given method as Q_INVOKABLE and i set the context property of the qml document to the instance of the class .But it is showing me an error i am unable to call the method.please solve the problem.