I’m very excited on the last 2 days since the Sailfish OS Alpha SDK was released. I’m working on a new project for harmattan and hence I would like to test it out how easy it was to port the UI from Harmattan to Sailfish Silica. Well, that’s another story hence I won’t cover it in this post. All I want to share with you is that I faced a little problem when I want to setContextProperty() to share a list model from Qt to QML.
For example, if I want to share a QAbstractListModel called “piModel” to QML, here’s the code
view->rootContext()->setContextProperty("listModel", piModel);
view->setSource(QUrl("qrc:///main.qml");
Then in QML ListView, just set the model: listModel and the list will appear and automatically updated should there be any addition/delete in the Qt si...
Read More










