[Qt-qml] Add Remove animations in ListView

Ivan De Marino ivan.de.marino at gmail.com
Tue Mar 30 01:51:19 CEST 2010


I didn't try myself yet, but if you make a subclass of QAbstractListModel,
and you implement all the proper methods there (read the doc), new data
should get dynamically added.

Now, the animation. There should be stuff in the QML ListView documentation
to "animate" the arrive of new items.

Trolls, am I wrong?

On 29 March 2010 23:12, Adriano Rezende <adriano.rezende at openbossa.org>wrote:

> Hi everyone,
>
> Is there a way to apply add/remove animations in the ListView when an
> item is added or removed from a model?
>
> The use cases most wanted by designers are:
>
> 1. When an item is added: All items below it will move down and the
> new item will fade in in the new empty space
> 2. When an item is removed: The removed item will fade out, and all
> items below it will move up to reorganize the list
> 3. When an item is moved: A sequential animation of (2) and (1) will take
> place
>
> A big problem that raises in this scenario is how to keep model and
> list in 'synchrony', since the model accepts synchronous operations
> and the list will handle these operations asynchronously.
> If the model does not have a freeze operation, to avoid other
> add/remove requests while animating, at some point some animations in
> the queue will be dropped since the model data/order does not match
> anymore, unless you keep a model snapshot for each operation which
> will result in a much more complex task.
>
> Is there an official way to handle this kind of use case or a possible
> workaround to implement this?
>
>
> Cheers,
> Adriano
> _______________________________________________
> Qt-qml mailing list
> Qt-qml at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-qml
>



-- 
Ivan De Marino | Software Engineer | France Telecom R&D UK - Orange Labs
w. +44 20 8849 5806 | m. +44 7515 955 861 | m. +44 7974 156 216
ivan[dot]demarino[at]orange-ftgroup.com |
ivan[dot]de[dot]marino[at]gmail[dot]com
www.detronizator.org | www.linkedin.com/in/ivandemarino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100330/264de4d0/attachment.html 


More information about the Qt-qml mailing list