12-08-2012 06:25 PM
I am trying to access one of the QML elements using C++ code. I have read a lot of forums and the developer guide - specifically the part on how to make QML and C++ work together.
This is my code:
QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(th
AbstractPane *root = qml->createRootObject<AbstractPane>();
ListView *listView = root->findChild<ListView*>("eventsList");
listView->setDataModel(groupDataModel);
And I get ...
error: no matching function for call to 'bb::cascades::AbstractPane::findChild(const char [11])'
candidate is: /Applications/bbndk/target_10_0_9_1101/qnx6/usr/in
The above code is the recommended way to get QML element from what I read.
Any help on this would be appreciated.
Thank you,
Dax
12-08-2012 11:48 PM
12-09-2012 08:25 PM
I have created the default empty project template from Momentics IDE (Beta 4) and added the one line below:
ListView *listView = root->findChild<ListView*>("eventsList");
With the default empty project template, how can I get an error?
I have the default imports:
#include <bb/cascades/Application>
#include <bb/cascades/QmlDocument>
#include <bb/cascades/AbstractPane>
using namespace bb::cascades;
Are there additional imports/namespaces I need to add to this?
12-09-2012 11:30 PM