On 11/22/2011 09:41 AM, bea....@nokia.com wrote: > On 22/11/2011, at 6:15 PM, ext Harri Pasanen wrote: >> Component.onCompleted: { >> console.log("completed") >> console.log(pie.slices) >> console.log(pie.slices[1].color) >> } >> } >> >> >> When I run chapter5-listproperties project with this, it spits out >> >> TypeError: Result of expression 'pie.slices[1]' [undefined] is not an object. >> > > Ah, I see - in this case, the PieChart class needs to pass an AtFunction as > well as a AppendFunction to the QDeclarativeListProperty constructor. The > AtFunction will provide index-based access to objects within the list. In the > BirthdayParty example, this functionality was added automatically, since the > example used the convenience constructor of QDeclarativeListProperty.
Ok, makes sense. Thanks for the explanation. /Harri _______________________________________________ Qt-qml mailing list Qt-qml@qt.nokia.com http://lists.qt.nokia.com/mailman/listinfo/qt-qml