Hi Shaun There's just a mistake in math when calculating x for the rectangles after the one being clicked. Change index * (width + view.spacing) - (width/2) to index * (width + view.spacing) - (width/2) - view.spacing
See full code with coordinates printed at http://pastebin.com/QpzJ3uYE In general though I don't think it's a good idea to mix List or Row with manual coordinate calculation - it's too easy to miss yet another automatic "help" from positioners. If you want to set coordinates manually anyway, why not to put them to rectangle and use Repeater for adding them from the model if you need. Best regards, Artem. On Aug 7, 2011, at 6:16 PM, Shaun Reich wrote: > Hello, > > I'm trying to achieve a look of having horizontal items laid out > linearly, and when one of them is clicked, that item will move down a > row and into the center (horizontal center, that is). > > This wiki entry contains what I am doing > http://developer.qt.nokia.com/wiki/ListView_Item_Manual_Positoning_Animations_QML > > This works great, however as I noted at the bottom, there are issues > when I change the contents of the model. The spacing of the items > screws up (it seems to be the x value), and it doesn't look like it > has to do with the positioning code. > > To muddy the waters more...I've tried this with a Row { Repeater { > Image {} } }, and it has the same issue. However, when I remove the > row, it has no issues. > > This led me to believe that perhaps anchors are coming into play here, > which do not like my hard-coded sizes. > > How can I achieve the desired effect? I really don't care how it is > achieved, it probably doesn't have to be anything special, because I > don't even particularly need a listview (since I got away with a > repeater)... > But then with the repeater, I can't see how to move the entire group > of contents to whereever I want, ideally anchored somewhere. (it just > appears at the top-left now). > > Any help is appreciated, as I've been stuck on this for quite some > time, and I only have so much hair ;-) > > -- > Shaun Reich, > KDE Software Developer (kde.org) > _______________________________________________ > Qt-qml mailing list > [email protected] > http://lists.qt.nokia.com/mailman/listinfo/qt-qml
_______________________________________________ Qt-qml mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt-qml
