[Qt-qml] dynamically updatable model in QML ListView

Pelle Johnsen pelle.johnsen at gmail.com
Fri May 20 11:22:30 CEST 2011


You need to use QML ListModel or C++ QAbstractListModel, for changes to be
picked up by ListView.

ListModel is a lot easier if you are not used to Qt's item views.

http://doc.qt.nokia.com/4.7-snapshot/qml-listmodel.html

<http://doc.qt.nokia.com/4.7-snapshot/qml-listmodel.html>Rgrds,

 -Pelle

On Fri, May 20, 2011 at 11:16 AM, vineeth <nvineeth at gmail.com> wrote:

> Hello all,
>   I am a newbie and had a doubt related to QML ListView model. In this
> example :
> http://doc.qt.nokia.com/4.7/declarative-modelviews-stringlistmodel.html ,
> a C++ QStringList is being used as a model in the view.qml file<http://doc.qt.nokia.com/4.7/declarative-modelviews-stringlistmodel-view-qml.html>
> .
>   However, If I add an item to this QStringList ( For ex: In response to a
> UI click event  ), the newly added items to the QStringList are not
> reflected in the UI ListView. How can we ensure that the QStringList
> elements are in sync with the QML ListView. Kindly let me know.
>
> Thanks.
> --vineeth
>
> _______________________________________________
> Qt-qml mailing list
> Qt-qml at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-qml
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20110520/a9e1ba9f/attachment-0001.html 


More information about the Qt-qml mailing list