From 082cc5aba6ea7eed13fc521b26f005c71970aa27 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Wed, 1 Feb 2012 16:04:31 +1000 Subject: 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 --- .../auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp | 2 +- .../auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/declarative') 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(); } -- cgit v1.2.3