summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2012-02-01 16:04:31 +1000
committerAndrew den Exter <andrew.den-exter@nokia.com>2012-02-01 07:53:47 +0100
commit082cc5aba6ea7eed13fc521b26f005c71970aa27 (patch)
treef563d9e4658d996569950b4cd0005fbb74742df5
parent507c01fe7ff6fdd51bc2bcf73ea87ce6b02ca321 (diff)
Fix ListView and GridView test failures.
The QAbstractItemModel moved signals expect the destination index to be relative to the list prior to the moved items being removed. Change-Id: If992b7f305677dac284e152fd44e55c258c85dc3 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
-rw-r--r--tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
index 2e3b8b25..574bff14 100644
--- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
+++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
@@ -167,7 +167,7 @@ public:
}
void moveItem(int from, int to) {
- emit beginMoveRows(QModelIndex(), from, from, QModelIndex(), to);
+ emit beginMoveRows(QModelIndex(), from, from, QModelIndex(), to > from ? to + 1 : to);
list.move(from, to);
emit endMoveRows();
}
diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
index 08a3e000..f26d5aee 100644
--- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
+++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
@@ -333,7 +333,7 @@ public:
}
void moveItem(int from, int to) {
- emit beginMoveRows(QModelIndex(), from, from, QModelIndex(), to);
+ emit beginMoveRows(QModelIndex(), from, from, QModelIndex(), to > from ? to + 1 : to);
list.move(from, to);
emit endMoveRows();
}