[Qt-qml] accessing model method from a delegate

Stephen Kelly steveire at gmail.com
Tue May 24 16:32:12 CEST 2011


vineeth wrote:

> Hello,
>   I have a newbie question :
>   In a C++ abstract model list view I have a q_invokable method , and from
> Qml I can call it as  : ListView.view.model.method_name , but not simply
> as model.method_name
>   what is the difference between ListView.view.model and just model in a
> delegate, (I thought both were same)?

Unfortunately there are lots of 'model's. model as available in the delegate 
just has a couple of things available through it like model.index, but it's 
just a magic variable available in the delegate. myView.model or 
ListView.view.model is the actual model object.




More information about the Qt-qml mailing list