[Qt-qml] Transforming a model (like 'list comprehension')

Ville M. Vainio vivainio at gmail.com
Wed Nov 10 21:41:49 CET 2010


Suppose I have model with items like this:

ListItem { x : 1; y: 2 }

And I need a model with items like this:

ListItem { z : 1 + 2 }

What should I do? My gut tells me that it's not possible in a clean
way, but I hope to be proven wrong :).

Actually, my *real* need is more mundane - I want to rename a property
on-fly. But as at excercise in learning to 'map' QML conpects to stuff
you've got to know in other languages (here, "list comprehension" from
python or haskell comes to mind), I thought I'd throw this here.

-- 
Ville M. Vainio @@ Forum Nokia



More information about the Qt-qml mailing list