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

Reply
Contributor
Offo
Posts: 27
Registered: ‎05-07-2012
My Device: PlayBook and Bold 9900
My Carrier: Wind
Accepted Solution

Display non grouped data from database to ListView

How can I read data from a SQLite table and display it on a ListView without the GroupDataModel. I do not want my list to be grouped.

Please use plain text.
Trusted Contributor
AllSystemGo
Posts: 140
Registered: ‎11-23-2010
My Device: Torch 9800
My Carrier: Rogers

Re: Display non grouped data from database to ListView

You don't actually have to group it, just do it this way

 

GroupDataModel* dm = new GroupDataModel(QStringList() << "item_id");
    dm->setGrouping(ItemGrouping::None);

 

Hope it helps

Please use plain text.
Developer
rock_win
Posts: 136
Registered: ‎02-01-2009
My Device: Not Specified

Re: Display non grouped data from database to ListView

If you have a mixture of both QML and C++ then you can also use other Model types.

 

In the end it should be only converted to QVariant* type for it.

"

A DataModel can come in a number of different forms, including XmlDataModel (data from an XML file), QListDataModel (a QList containing QVariant objects), and GroupDataModel (QVariantMap objects and/or QObject pointers).

ListView takes ownership of any QObject objects (wrapped in QVariant) returned by DataModel::data(), unless those objects already have parents."

 

 

Option2 : if its totally c++ based, then you get the full control through the ListItemManager

Please use plain text.
BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha
My Carrier: N/A

Re: Display non grouped data from database to ListView

Please use plain text.
BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha
My Carrier: N/A

Re: Display non grouped data from database to ListView

Any progress on this front?

Please use plain text.