diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-02-23 04:05:06 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2011-02-23 06:33:26 (GMT) |
commit | d9d68c383b7b1438d3034cd3708cfba5fb9706ef (patch) | |
tree | 0b42a5a01b81304d770cbc16c4069a05b6430f8c /tests | |
parent | f93d1245e5c36cf25cd6fd3c3418ee7e63e04ac2 (diff) | |
download | Qt-d9d68c383b7b1438d3034cd3708cfba5fb9706ef.zip Qt-d9d68c383b7b1438d3034cd3708cfba5fb9706ef.tar.gz Qt-d9d68c383b7b1438d3034cd3708cfba5fb9706ef.tar.bz2 |
DelayRemove of list delegate on section boundary duplicated section
When removing a delegate with a removal animation that fell on a
section boundary (i.e. owned the section header), the following
item would also create a section header before the previous item was
removed. Make updateSections() include the removed, but visible items
in its update. Ensure updateSections() is called when the removed
item is destroyed to ensure a new section header is created at that
point.
Change-Id: Ie831e3acf65b2989ebb030e2ab38cdbe179a9d45
Task-number: QTBUG-17606
Reviewed-by: Michael Brasser
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml | 5 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp | 13 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml b/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml index 35a398b..9d9cda8 100644 --- a/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml +++ b/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml @@ -41,6 +41,11 @@ Rectangle { text: wrapper.y } } + ListView.onRemove: SequentialAnimation { + PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true } + NumberAnimation { target: wrapper; property: "height"; to: 0; duration: 100; easing.type: Easing.InOutQuad } + PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false } + } } } ] diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index f358625..c7f90da 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -1078,6 +1078,19 @@ void tst_QDeclarativeListView::sectionsDelegate() QTRY_COMPARE(item->y(), qreal(i*20*6)); } + // remove section boundary + model.removeItem(5); + qApp->processEvents(); + for (int i = 0; i < 3; ++i) { + QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, + "sect_" + (i == 0 ? QString("aaa") : QString::number(i))); + QVERIFY(item); + } + + // QTBUG-17606 + QList<QDeclarativeItem*> items = findItems<QDeclarativeItem>(contentItem, "sect_1"); + QCOMPARE(items.count(), 1); + delete canvas; } |