[SailfishDevel] Technical question: populating ListModel from C++

Janne Kokko jmkokko1 at gmail.com
Fri May 23 06:25:59 UTC 2014


Hi,

I suggest you implement the model yourself by subclassing QAbstractItemModel.

See http://qt-project.org/doc/qt-5/qtquick-modelviewsdata-cppmodels.html
and http://qt-project.org/doc/qt-5/qabstractitemmodel.html to get
started.

--
Janne

2014-05-23 9:17 GMT+03:00 Kimmo Lindholm <Kimmo.Lindholm at eke.fi>:
> Hi All,
>
>
>
> What would be the best method to populate ListModel in QML from the C++
> side?
>
>
>
> I have sqlite database, which contents I would like to put on ListView.
>
>
>
> List is changed only by user when deleting or adding entry, upon this action
> I would like to update sqlite and then refresh listmodel.
>
>
>
> -kimmo
>
>
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org


More information about the Devel mailing list