On Mon, Jan 27, 2014 at 1:21 AM, Damian Ivanov <damianator...@gmail.com> wrote: > Hi, > > I have QML c++ plugin which I import inside the .qml files using > import MyPlugin 1.0 > In the plugin I have a QList<int> which I want to expose to .qml for a > ListView(and other views) as the modelData. What is the right way to > do it?
You can expose it as a context property, https://qt-project.org/doc/qt-5/qqmlcontext.html#setContextProperty-2 , on the rootContext() of the QQmlEngine. Or you can make it a property on a singleton type: https://qt-project.org/doc/qt-5/qtqml-cppintegration-definetypes.html#registering-singleton-objects-with-a-singleton-type . -- Alan Alpert _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest