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

Markus Svensson markus.svensson at me.com
Fri May 23 07:53:25 UTC 2014


Hi,

I have done the same thing in my Sailfish learning project. It was way more complicated than I would have liked it to be (or maybe I did it in the wrong way...).

Feel free to have a look at how I implemented it: https://github.com/Ortofta/SilicaNote

The code quality is probably not the best - these are my first baby steps in QT and Sailfish. ;)

Regards,
Markus


> 23 maj 2014 kl. 08:52 skrev Kimmo Lindholm <Kimmo.Lindholm at eke.fi>:
> 
> Hi,,
>  
> Thank you Janne and Jarko, I will take a look on both of these approaches;
>  
> > use the QSqlQueryModel in your c++ and expose that to QML ; just like in : http://qt-project.org/wiki/How_to_use_a_QSqlQueryModel_in_QML
>  
> > 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.
>  
>  
> -kimmo
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20140523/6600aa78/attachment.html>


More information about the Devel mailing list