01-31-2014 05:37 AM
i'm a create a model class in cpp which inherits bb::cascades::datamodel, this model using in listview as datamodel. data() of the datamodel return class (wrapped in Qvariant). this class have some property which is used in listview. i'm facing a problem when we scrolling the list those item used again when another item of the same type scrolls into the visible area.
So, is there any signals or workaround to not reuse cell.
any suggestions are welcome.
Thanks and regards
01-31-2014 05:49 AM
01-31-2014 07:16 AM
Before implementing this ,I used the container but now i need some customization over the cell. Thats why i have to use ListView.
Can you please elaborate how would i use listitemprovider and also how to associate with model class and
01-31-2014 07:36 AM
There's a good explanation by Peter here on the problem...
My suggestion is to write this 'reuse' info back to your model or create your own ListView custom control.
01-31-2014 08:06 AM - edited 01-31-2014 08:12 AM
ListItemProvider uses VisualNode objects as items in a ListView.
but here i'm using cpp class to populate listview item.
so how i can use listitemprovider for escaping from reuse of listview.
or correct me if i am wrong.
01-31-2014 08:15 AM
I'm struggling to understand your last post, whether you use C++ or QML makes no difference.
If you read the link I gave you you would see that ListItem.initialised let's you know if the item has been recycled or not, with that you should be able to write code that will either update or not update the visual componant as required dependant on that property.
02-01-2014 01:53 AM
Actually, as i understand ,the ListItemProvider providing VisualNode objects in listview. and A visual node in the scene graph.
but in my scenario i'v a own model class in cpp which inherits bb::cascades::datamodel, this model used in listview as datamodel. data() function of the model class return class (wrapped in Qvariant). So i'm confuse now, how i can use ListitemProvider class to update listview cell. or is another way to update cell after recycle in listview.
02-02-2014 10:52 PM
Post your list code so i can help you fix it. I've run into this kind of issue many times before and its easy to fix. Usually you just have to make sure that you reference directly to the datamodel and not on bindings.