aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@jollamobile.com>2014-07-23 17:51:37 +1000
committerMartin Jones <martin.jones@jollamobile.com>2014-07-25 02:58:24 +0200
commit39c144f44be76ccc7bdec540a7b7ec00cf0fdc5d (patch)
tree65a49bcc2b84b6594f2a2127d632cc48fbdc7edb /tests
parent79f262711c053608c7b0d775a8c7031368ddd17f (diff)
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 <andrew.den.exter@qinetic.com.au>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/qquickgridview/tst_qquickgridview.cpp9
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp9
2 files changed, 10 insertions, 8 deletions
diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
index 863fb69b84..a350074b42 100644
--- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
+++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
@@ -3613,12 +3613,13 @@ void tst_QQuickGridView::resetModel_headerFooter()
model.reset();
- header = findItem<QQuickItem>(contentItem, "header");
- QVERIFY(header);
+ // A reset should not force a new header or footer to be created.
+ QQuickItem *newHeader = findItem<QQuickItem>(contentItem, "header");
+ QVERIFY(newHeader == header);
QCOMPARE(header->y(), -header->height());
- footer = findItem<QQuickItem>(contentItem, "footer");
- QVERIFY(footer);
+ QQuickItem *newFooter = findItem<QQuickItem>(contentItem, "footer");
+ QVERIFY(newFooter == footer);
QCOMPARE(footer->y(), 60.*2);
delete window;
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<QQuickItem>(contentItem, "header");
- QVERIFY(header);
+ // A reset should not force a new header or footer to be created.
+ QQuickItem *newHeader = findItem<QQuickItem>(contentItem, "header");
+ QVERIFY(newHeader == header);
QCOMPARE(header->y(), -header->height());
- footer = findItem<QQuickItem>(contentItem, "footer");
- QVERIFY(footer);
+ QQuickItem *newFooter = findItem<QQuickItem>(contentItem, "footer");
+ QVERIFY(newFooter == footer);
QCOMPARE(footer->y(), 30.*4);
delete window;