From 19977e9686a482a8189d928d8a45b282cb4287ba Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Tue, 27 Mar 2012 14:34:58 +1000 Subject: Buffer changes received during layout() Otherwise, changes received by a view during layout() may override the changes that are currently being processed. Change-Id: Iabc4db682f85ceb7d04c3f7442fb6c98ebdb94f1 Reviewed-by: Andrew den Exter --- .../qquicklistview/data/destroyItemOnCreation.qml | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/auto/quick/qquicklistview/data/destroyItemOnCreation.qml (limited to 'tests/auto/quick/qquicklistview/data') diff --git a/tests/auto/quick/qquicklistview/data/destroyItemOnCreation.qml b/tests/auto/quick/qquicklistview/data/destroyItemOnCreation.qml new file mode 100644 index 0000000000..12f43b029a --- /dev/null +++ b/tests/auto/quick/qquicklistview/data/destroyItemOnCreation.qml @@ -0,0 +1,37 @@ +import QtQuick 2.0 + +Rectangle { + id: root + + width: 240 + height: 320 + + property int createdIndex: -1 + + Component { + id: myDelegate + + Rectangle { + id: wrapper + width: 240; height: 20 + objectName: "wrapper" + + Text { text: index } + + Component.onCompleted: { + root.createdIndex = index + ListView.view.model.removeItem(index) + } + } + } + + ListView { + id: list + objectName: "list" + focus: true + width: 240 + height: 320 + delegate: myDelegate + model: testModel + } +} -- cgit v1.2.3