aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2012-01-04 17:55:26 +1000
committerQt by Nokia <qt-info@nokia.com>2012-01-04 10:22:53 +0100
commit47d5104ab3f02a8ba538dee6e7258f94b213a16f (patch)
tree274fed657faca42c24a43611e64819c172bceefc /tests
parenteaf56d3dabad07af2e1b24536833fdb5e2a74a03 (diff)
Fix moving mixed visible and non-visible View items.
A removal for a move that included both cached and non-cached was only evaluating the first part of the removal and skipping the remainder. Don't skip all subsequent removals when two ranges are merged, instead reset the current indexes to the start of the merged range and continue on as normal. Task-number: QTBUG-23432 Change-Id: Ieda49e2f68cd0bbbd31ba1e7dfd5af7c3e350d78 Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativelistcompositor/tst_qdeclarativelistcompositor.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativelistcompositor/tst_qdeclarativelistcompositor.cpp b/tests/auto/declarative/qdeclarativelistcompositor/tst_qdeclarativelistcompositor.cpp
index edceff23fb..f59a19437c 100644
--- a/tests/auto/declarative/qdeclarativelistcompositor/tst_qdeclarativelistcompositor.cpp
+++ b/tests/auto/declarative/qdeclarativelistcompositor/tst_qdeclarativelistcompositor.cpp
@@ -1501,6 +1501,25 @@ void tst_qdeclarativelistcompositor::listItemsMoved_data()
<< IndexArray(defaultIndexes)
<< IndexArray()
<< IndexArray(selectionIndexes);
+ } { static const int cacheIndexes[] = {/*A*/0,1,2,3,4,5,8,9};
+ static const int defaultIndexes[] = {/*A*/0,1,2,3,4,5,6,7,8,9,10,11};
+ QTest::newRow("move mixed cached items")
+ << (RangeList()
+ << Range(a, 0, 1, C::PrependFlag | C::DefaultFlag | C::CacheFlag)
+ << Range(a, 1, 2, C::PrependFlag | C::DefaultFlag)
+ << Range(a, 3, 7, C::PrependFlag | C::DefaultFlag | C::CacheFlag)
+ << Range(a, 10, 2, C::PrependFlag | C::DefaultFlag))
+ << a << 1 << 6 << 3
+ << (RemoveList()
+ << Remove(0, 0, 1, 1, 2, C::PrependFlag | C::DefaultFlag, 0)
+ << Remove(0, 0, 1, 1, 1, C::PrependFlag | C::DefaultFlag | C::CacheFlag, 1))
+ << (InsertList()
+ << Insert(0, 0, 6, 6, 2, C::PrependFlag | C::DefaultFlag, 0)
+ << Insert(0, 0, 8, 6, 1, C::PrependFlag | C::DefaultFlag | C::CacheFlag, 1))
+ << IndexArray(cacheIndexes)
+ << IndexArray(defaultIndexes)
+ << IndexArray()
+ << IndexArray();
}
}