Ah, sorry, If I understand well, you actually want to do that with
standard ListModel / ListElement? This is not possible with
ListElement, but could probably be done with VisualItemModel

My example was assuming two custom QML components (Menu and MenuItem),
and not the standard QML model items.

Short answer: you have to try out for yourself, but you will certainly
come up with a solution.


2010/11/16 Pertti Kellomäki <pertti.kellom...@nokia.com>:
> On 11/16/2010 03:00 PM, ext Gregory Schlomoff wrote:
>>
>> Easy, just bind your javascript code to a signal or a property.
>>
>> QML version of your pseudo-code :
>>
>> Menu {
>>   MenuItem {
>>     title: "save"
>>     onActivated: {
>>         var file = ....
>>         file.save();
>>     }
>> }
>>
>
> Thanks, I was hoping it would be this easy. Presumably I can then access the
> onActivated handler in the delegate via the view's currentItem property?
> --
> Pertti
>
>

_______________________________________________
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to