QML model with image and text per element

Shaun Reich predator106 at gmail.com
Sun Jun 26 20:46:56 CEST 2011


> well, i don't know how that data engine is done, but usually when representing
> a list of items they are done this way:
> sone source per item, like
> source called as the login, then one key per "role" for instance a key with
> login one with name, one with user image...
> from the dataengine you do for instabce setData("john", "name", "John Doe")


> alternatively, the source could be a functionality, like "userList", then
> userList will have a key for each user and then the same structure: every item
> a varianthash with all the user data...

The latter method seems the better route honestly. or at least I like
it the most. the other one, looks like it doesn't map very well to my
uses...although I can easily be convinced otherwise, if you hate my
api ;p

Okay, so if the data is laid out as you said, in the last example..how
would I display that in the qml view? Since I need to display *both*
the icon and the user's name in the model. Give me something concrete,
please -- as you well know, the docs suck ;-)

-- 
Shaun Reich,
KDE Software Developer (kde.org)


More information about the Plasma-devel mailing list