From kde-panel-devel Sun Jun 19 17:34:42 2011 From: Marco Martin Date: Sun, 19 Jun 2011 17:34:42 +0000 To: kde-panel-devel Subject: Re: Accessing models from QML plasmoid Message-Id: <201106191934.42936.notmart () gmail ! com> X-MARC-Message: https://marc.info/?l=kde-panel-devel&m=130850494028593 On Sunday 19 June 2011, Shantanu Tushar Jha wrote: > Hi, > > I am having the same doubt, I guess Marco can answer :) > > Shantanu Tushar (UTC +0530) > http://www.shantanutushar.com > > On Sat, Jun 18, 2011 at 12:37 AM, Francesco Nwokeka < > > francesco.nwokeka@gmail.com> wrote: > > Hi all, > > > > I'm working on a GSoC project and creating plasmoids for > > > > kde-telepathy. I would like to know > > from you guys, which would be the right approach to read info from a > > model we have that retrieves > > it's info from nepomuk. > > > > Do I have to wrap this model as a dataengine, or is there a better way to > > use a pre-existing > > QAbstractItemModel in Plasma-QML? to work in qml a qabstractitemmodel needs: * one single column * roles with actual names (assigned with setRoleNames) to be "seen" is either setContextProperty from C++ (but in this case you can't do a qml-only plasmoid, it would have to be mixed qml c++) or be exported in a plugin (that is then used with the import keyword) in this case the model would be created and instantiated from within qml in general, i prefer models in qml itemviews to be actual models, in libplasma2 i would instead like to have model support directly into the dataengine, that would be way cleaner, but unfortunately, not yet.. Cheers, Marco Martin _______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel