[Qt-qml] dynamically updatable model in QML ListView

Pelle Johnsen pelle.johnsen at gmail.com
Fri May 20 11:48:57 CEST 2011


If using ListModel you don't need to reassign the whole model (which is bad
as it requires ListView to recreate or at least reinitialize all delegates).

ListModel has methods for updating the model: append, insert, move, remove,
clear. I'm guessing it's using the item views mechanism under the hood to
inform ListView of the changes.

 -Pelle

On Fri, May 20, 2011 at 11:26 AM, Thomas Ganshorn <mailings at novaimages.de>wrote:

>  i read once that you have to reassign the modell to the listview.
>
> Not quite good implementation but there seems to be no other solution
> unless you want to write your own qaim model (wich is something i really
> hate and would always avoid if possible)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20110520/dff21436/attachment.html 


More information about the Qt-qml mailing list