On Fri, Sep 9, 2011 at 12:06 PM, Shawn <sh...@forevertrusts.com> wrote:
> Hi Riaan,
>
> Thank you for your suggestion, I add index attribute to the model, then
> it will work.

If all you need to do is compare the index to the currentIndex, you
don't need to define that index property. The ListView attaches a
boolean property to the instantiated delegate that indicates whether
the item is the current item. So you could get rid of that index
property by changing

 scale: (view.currentIndex == index) ? 1.2 : 1

to

 scale: ListView.isCurrentItem ? 1.2 : 1

Note that "ListView" isn't the id of the ListView element, but it's a
prefix for the name of the attached property. Here's a link to an
example in the official docs:
http://doc.qt.nokia.com/4.7-snapshot/qml-listview.html#isCurrentItem-prop

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

Reply via email to