summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-09-11 05:17:22 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-09-11 05:17:22 (GMT)
commitdf478cf9577c766a0a8d0bcb7b4da6c9c0be0171 (patch)
tree5e9864048666d1bfe14452be8b4468beddb281d1
parent3a4eb09c502d2394b35b62ca12b28cba392dc270 (diff)
downloadQt-df478cf9577c766a0a8d0bcb7b4da6c9c0be0171.zip
Qt-df478cf9577c766a0a8d0bcb7b4da6c9c0be0171.tar.gz
Qt-df478cf9577c766a0a8d0bcb7b4da6c9c0be0171.tar.bz2
Ensure item moves are passed on literally so views can animate literally.
-rw-r--r--src/declarative/util/qmllistmodel.cpp5
1 files changed, 4 insertions, 1 deletions
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);
}
/*!