diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-10-08 01:46:36 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-10-08 01:46:36 (GMT) |
commit | 0bf05331d901ca27e358ec22569a07489a70b7a5 (patch) | |
tree | e806bbbafb2ac086d1ce40691b0532d0cce104fe /tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp | |
parent | e72192e778a6670bd1384a4e5ab7012ac1525f1a (diff) | |
download | Qt-0bf05331d901ca27e358ec22569a07489a70b7a5.zip Qt-0bf05331d901ca27e358ec22569a07489a70b7a5.tar.gz Qt-0bf05331d901ca27e358ec22569a07489a70b7a5.tar.bz2 |
emit currentSectionChanged when section changes in ListView.
Task-number: QTBUG-13981
Reviewed-by: Michael Brasser
Diffstat (limited to 'tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index 6452bae..65ff635 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -937,6 +937,8 @@ void tst_QDeclarativeListView::sections() QCOMPARE(next->text().toInt(), (i+1)/5); } + QSignalSpy currentSectionChangedSpy(listview, SIGNAL(currentSectionChanged())); + // Remove section boundary model.removeItem(5); @@ -972,9 +974,13 @@ void tst_QDeclarativeListView::sections() listview->setContentY(140); QTRY_COMPARE(listview->currentSection(), QString("1")); + QTRY_COMPARE(currentSectionChangedSpy.count(), 1); + listview->setContentY(20); QTRY_COMPARE(listview->currentSection(), QString("0")); + QTRY_COMPARE(currentSectionChangedSpy.count(), 2); + item = findItem<QDeclarativeItem>(contentItem, "wrapper", 1); QTRY_VERIFY(item); QTRY_COMPARE(item->height(), 20.0); |