From df478cf9577c766a0a8d0bcb7b4da6c9c0be0171 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 11 Sep 2009 15:17:22 +1000 Subject: Ensure item moves are passed on literally so views can animate literally. --- src/declarative/util/qmllistmodel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/declarative/util/qmllistmodel.cpp b/src/declarative/util/qmllistmodel.cpp index 345bc3b..69bed25 100644 --- a/src/declarative/util/qmllistmodel.cpp +++ b/src/declarative/util/qmllistmodel.cpp @@ -499,6 +499,9 @@ void QmlListModel::move(int from, int to, int n) { if (from+n > count() || to+n > count() || n==0 || from==to || from < 0 || to < 0) return; + int origfrom=from; // preserve actual move, so any animations are correct + int origto=to; + int orign=n; if (from > to) { // Only move forwards - flip if backwards moving int tfrom = from; @@ -524,7 +527,7 @@ void QmlListModel::move(int from, int to, int n) for (; f != replaced.end(); ++f, ++t) *t = *f; } - emit itemsMoved(from,to,n); + emit itemsMoved(origfrom,origto,orign); } /*! -- cgit v0.12