How can I access a qml component in C++ of a page has been dynamically generated?

Hello

I am new to QML and stunts development and I have the following scenario. On my main page, I have a ListView and when you tap on a list item, a new page is created dynamically and push in the navigation stack. I am able to see the new page, but it is empty. Qml to this new page code is defined in a separate file called DirectionViewer.qml. To achieve this, in my main.qml file I have the following code:

attachedObjects:]
{ComponentDefinition}
ID: directionViewer
Source: "DirectionViewer.qml".
}
]

In DirectionViewer.qml, I created another display of list and gave it a name of object called directionList. My question is, how do I access 'directionList' in C++, so that I can put the dataModel of the list of my C++ code?

Thank you.

Write a method in C++ and pass your ListView.

void ListViewUtil::setDataModel(QObject* listViewObject)

In C++, you can cast QObject to ListView.

ListView listView = dynamic_cast(listViewObject);

Then set the data model.

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for

  • I really, really, really need the orange firefox button back.

    I can't use Firefox more if the orange Firefox button is not returned. Boredom and anger caused this is seriously to the point that it causes me physical pain. I would like to make a few comments about this change. 1. you (Firefox, employees and owne

  • iTunes does not recognize it's own version number

    When I try to update my mini iPad to the latest operating system, I get a message saying I need to install the latest version of iTunes first (12.1.2) When I check the version under aid number / about it shows the version number is 12.1.2.27. When I

  • How to remove the user account with password, start menu

    I got this laptop from my dads boss and there are two accounts of users per password and I don't know what they are, is it possible to remove them? because I can not get on the phone to use with these passwords there.

  • What is the best Forum on Windows address book

    I'm looking for answers to change the address book windows, the maximum size of the fields and how I might be able to import all or part of my address book Palm OS in the Windows address book. What is my best forum for this information please? Abrada

  • Necessity of 225 by email

    Original title: riverview134 I need to send emails to more than 225 people at the same time and sometimes, I need to do this more than once a day.  Direct mail doesn't let me do.  How can I request Live Mail to grant me permission to do so.