Thanks Lucien, The signal/slot approach worked like a charm.

On 10 October 2014 16:10, <sfietkonstan...@free.fr> wrote:

> Hello Olah,
>
> I would not recommand using Repeater for long list views, as Repeater do
> not manage the items. As you have guessed, ListView destroys items that are
> out of the view, to save memory and have better performances.
>
> In your case, the best way is to animate the removal only if the item is
> visible. This can be achieved quite easily:
>
> 1. create a signal inside the ListView (like doRemoval(int index)), and
> give it an id
> 2. inside each delegate, connect this signal to a method to perform
> animation and removal. Don't forget if the index sent by doRemoval matches
> the index of the delegate.
> 3. Send the signal when an item have to be removed, passing the index. If
> this item is out of the displayed items, nothing will happen, but if it is
> inside, the item will be removed.
>
> Regards,
> Lucien
>
>
> ----- Mail original -----
> De: "Krisztian Olah" <fasza2mob...@gmail.com>
> À: "Sailfish OS Developers" <devel@lists.sailfishos.org>
> Envoyé: Vendredi 10 Octobre 2014 17:00:42
> Objet: [SailfishDevel] ListView vs Repeater
>
>
>
> Hi everyone,
>
>
> I need some help between choosing ListView or Repeater.
>
>
> I've got a SilicaListView whose elements I want to remove(only remove,
> never add) dynamically from GUI. When I have fairly a long list count(~25),
> reaching the element with ListView.contentItem.children[index] is not
> possible for the mid to end of the list, probably because ListView destroys
> items that are not visible. When that happens children[index] will not
> refer to the same element as model.index and therefore I cannot call
> remove() on the item. Using a Repeater would of course prevent this, but I
> don't think I can have a RemoveAnimation and I think I would have to reset
> the model.
>
>
> Is there another way that I didn't think of that would allow me to remove
> items from my model with animation and would allow me to have a list up to
> 1000 members(in real use it will probably be under 100) long?
>
>
> Thanks in advance
> Kris
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to
> devel-unsubscr...@lists.sailfishos.org
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to
> devel-unsubscr...@lists.sailfishos.org
_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Reply via email to