Hi, I think the correct way is to modify the model directly so the delegate will update if the bindings are correct.
You can define the delegate as something like this: Component{ id:testViewDelegate Item{ scale: model.isScaled ? 2 : 1 width: 100 height: 30 Image { id: image width: 30 height: 30 source: model.contactImage } } Best regards. On Thursday, September 8, 2011, Shawn wrote: > Hi guys, > > I want to access item in ListView delegate, like below code snippet, > I want to change image's property, which is in the delegate of testView. > It doesn't work. How can I access it or am I in the wrong way? > Any suggestion could be helpful. > Thank you very much! > ListView { > id: testView > model: easyNameModel > delegate: testViewDelegate > highlight: Rectangle {color: "green"; radius: 5; > width: listview2.width; height: itemHeight > } > > Keys.onPressed: { > if(event.key == Qt.Key_Down) > { > //image.scale = 2; // This doesn't work > listview2.incrementCurrentIndex(); > } > > } > > Component{ > id:testViewDelegate > Item{ > width: 100 > height: 30 > Image { > id: image > width: 30 > height: 30 > source: model.contactImage > } > } > } > } > > > Best Regards, > Shawn > > _______________________________________________ > Qt-qml mailing list > Qt-qml@qt.nokia.com <javascript:;> > http://lists.qt.nokia.com/mailman/listinfo/qt-qml >
_______________________________________________ Qt-qml mailing list Qt-qml@qt.nokia.com http://lists.qt.nokia.com/mailman/listinfo/qt-qml