[SailfishDevel] What's the correct way to do this?

Andrey Kozhevnikov coderusinbox at gmail.com
Sat Jun 6 06:27:11 UTC 2015


If you need just some  fields from model you can pass them to 
parameters, instead of whole model. Other way would be parsing model 
inside onClicked handler. Or use kimmoli suggestion and implement get or 
getModel method on model class for returning const QVariantMap.

05.06.2015 21:06, Chris Walker пишет:
> Perhaps somebody can either help me with this one or point me to some
> docs that tell me the correct way to do it.
>
> I want to pass several bits of information to another qml page. I've
> looked at the various pages and they only tell me how to pass variables
> not how to set them up in the first place which is where I'm struggling.
>
> My qml (at the end of a label) looks like this :-
> onClicked: console.log("Clicked " + mark + " " + model + " " + register)
>                         // + { passcarDetails(model);
>
> The console shows that the three pieces of information are being
> selected and part of my function looks like this :-
>      function passcarDetails(carDetails)
>      {
>          console.log("about to push to CarRecordPage, for car - id: " +
>                       carDetails.id + ", register: " +
>                       carDetails.register)
>
> It's failing at that point as the console says :-
> passcarDetails:40 - about to push to CarRecordPage, for car - id:
> undefined, register: undefined
>
> So where am I going wrong, and more importantly, what can I do about it?
>
> Any help appreciated.
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org



More information about the Devel mailing list