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

New Contributor
Posts: 4
Registered: ‎03-14-2011
My Device: BB 10
My Carrier: None

QML to C++ Reference error

I have a settings class with Q_INVOKABLE functions and settings.qml with a page object. I push the page(settings.qml) onto my NavigationPane(root), and set qml context property to have access to the settings class (qml->setContextProperty("settings", m_settings)).The reference successfully works, but I am getting an error in the console:

file:///accounts/...../app/native/assets/settings.qml:82: ReferenceError: Can't find variable: settings

The class functions are accessible, BUT why is there an error in the console?

Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: QML to C++ Reference error

Do you have an objectName defined in settings.qml named "settings"?


setContextProperty() binds a QML objectName to a C++ object, it can't be used to bind to a QML file which looks like you may be doing.

Goodbye everybody!