From 39c144f44be76ccc7bdec540a7b7ec00cf0fdc5d Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 23 Jul 2014 17:51:37 +1000 Subject: Don't recreate header and footer unnecessarily The only time that they need to be recreated is if the orientation changes (even then, a good implementation could handle it, but no point requiring that now). Task-number: QTBUG-40375 Change-Id: Id0215fb812724827bb139cda8f8dc6208c703852 Reviewed-by: Andrew den Exter --- tests/auto/quick/qquicklistview/tst_qquicklistview.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests/auto/quick/qquicklistview') diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp index 14e26b720c..b561258351 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -4081,12 +4081,13 @@ void tst_QQuickListView::resetModel_headerFooter() model.reset(); - header = findItem(contentItem, "header"); - QVERIFY(header); + // A reset should not force a new header or footer to be created. + QQuickItem *newHeader = findItem(contentItem, "header"); + QVERIFY(newHeader == header); QCOMPARE(header->y(), -header->height()); - footer = findItem(contentItem, "footer"); - QVERIFY(footer); + QQuickItem *newFooter = findItem(contentItem, "footer"); + QVERIFY(newFooter == footer); QCOMPARE(footer->y(), 30.*4); delete window; -- cgit v1.2.3