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
Developer
Posts: 136
Registered: ‎02-01-2009
My Device: Not Specified

How to change ListView- GroupDataModel UI from QML

Hi,

 

As a genreal practise of the keeing UI and Bussiness logic separately. I'm trying to have the following setup:

 

UI - QML:

  •  screen layout - with list view component

 

C++ code:

  • ListView reference through objectName
  • GroupDataModel with data fectched from an external source and supplied in the QStringList format

This is somewhere in the middle of the GroupDataModel example at: https://developer.blackberry.com/cascades/documentation/ui/lists/groupdatamodel.html

 

"

Creating a GroupDataModel in C++"

 

but the problem i'm facing is:

 

1. If it were to be an XMLListModel - i could have used the ListComponent - type - property to set the UI of different rows/types

 

But how can i do the same thing for the GroupDataModel which is in Code.

- Both for the header and other list items?

 

P.S: This attempt of mine is to achieve without QML and C++ bindings, but feel free to let me know, that a binding will be required and thus data insertion and its UI should be then managed through QML Smiley Happy

Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: How to change ListView- GroupDataModel UI from QML

I'm not sure I understand you question.

 

Can you look at samples quotes and stampcollector.

Note also this line:

mStampModel->setGrouping(ItemGrouping::ByFullValue);

 

Also look at cascades knowledge base articles "Using your own data model" and "Using a Custom DataModel to Filter Data for a List View"  (in http://supportforums.blackberry.com/t5/Cascades-Development-Knowledge/tkb-p/Cascades%40tkb)

 

After reading these, if you still have a question can you rephrase it?

 

Stuart

 

Developer
Posts: 136
Registered: ‎02-01-2009
My Device: Not Specified

Re: How to change ListView- GroupDataModel UI from QML

I wanted to change the theme of indiviudal row items, and got it by changing the QML with code on the lines of

StandardListItem{
type:"item"
label
image ...
}
}