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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 151
Registered: ‎09-28-2012
My Device: Blackberry Developer
My Carrier: Aircel

how to get data in qml from the class

hello,

 

i have a QList<QString> which have some data , i need to access the data of QList into ListView,

 

so that i can make my ListView dynamic..

 

Thanx.. Smiley Happy


----------------------------------------------------------
Feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
Retired
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: how to get data in qml from the class

You may want to take a look at the ArrayDataModel, or perhaps a GroupDataModel

 

https://developer.blackberry.com/native/reference/cascades/bb__cascades__arraydatamodel.html?f=datam...

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: how to get data in qml from the class

there is a concept to male a qlist accessible as a property (qdeclarativelistproperty), but it requires some overhead and did not work good for me.
I usually provide an own class for the list and give it accessors with Q_INVOKABLE size() and elementAt(index) functions.

for example:
a class User has a list of UserContent objects.
I create a new class called UserContents which contains this list and also provides the size, elements etc as Q_INVOKABLE.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Highlighted
Developer
Posts: 151
Registered: ‎09-28-2012
My Device: Blackberry Developer
My Carrier: Aircel

Re: how to get data in qml from the class

thanx guys..

 

let me try..


----------------------------------------------------------
Feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.