[Qt-qml] QML Listmodel as param into plugin

Lars Kinnunen lars.kinnunen at nomovok.com
Fri Jul 2 20:03:19 CEST 2010


 Hi, I was wondering if someone could help me with putting QML ListModel
as param into a plugin?

 It is fairly simple the other way around, there are many examples like
the QDirModel in documentation.
----
  QDeclarativeView view;

  QDirModel model;
  view.rootContext()->setContextProperty("dirModel", &model);
----

 Now the tricky part is, how is it done the other way around? if I am
interested in getting the ListModel into a plugin and append some
ListElements to it?

 I have tested a bit with QDeclarativeListReference, QDeclarativeProperty
and QAbstractListModel, but I didn't quite get it working. all I got was
complains like QMetaProperty::read: Unable to handle unregistered
datatype 'QDeclarativeListReference*' for property
'QDeclarativeBoundSignalParameters::target'.

It has been bugging me which would be "Q" equivalent of ListModel. at
least even Q_INVOKABLE void myfunction(QList & target); wasn't working
either.

Any help is much appreciated.


-- 
Lars Kinnunen




More information about the Qt-qml mailing list