aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickgridview/data/contentHeightWithDelayRemove.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquickgridview/data/contentHeightWithDelayRemove.qml')
-rw-r--r--tests/auto/quick/qquickgridview/data/contentHeightWithDelayRemove.qml47
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickgridview/data/contentHeightWithDelayRemove.qml b/tests/auto/quick/qquickgridview/data/contentHeightWithDelayRemove.qml
new file mode 100644
index 0000000000..3f8246bafc
--- /dev/null
+++ b/tests/auto/quick/qquickgridview/data/contentHeightWithDelayRemove.qml
@@ -0,0 +1,47 @@
+import QtQuick 2.1
+
+Item {
+ width: 400
+ height: 600
+ function takeOne()
+ {
+ gridView.model.remove(2)
+ }
+ function takeThree()
+ {
+ gridView.model.remove(4)
+ gridView.model.remove(2)
+ gridView.model.remove(0)
+ }
+ function takeAll()
+ {
+ gridView.model.clear()
+ }
+
+ GridView {
+ id: gridView
+
+ property bool useDelayRemove
+
+ height: parent.height
+ width: 400
+ cellWidth: width/2
+ model: ListModel {
+ ListElement { name: "A" }
+ ListElement { name: "B" }
+ ListElement { name: "C" }
+ ListElement { name: "D" }
+ ListElement { name: "E" }
+ }
+ delegate: Text {
+ id: wrapper
+ height: 100
+ text: index + gridView.count
+ GridView.delayRemove: gridView.useDelayRemove
+ GridView.onRemove: SequentialAnimation {
+ PauseAnimation { duration: wrapper.GridView.delayRemove ? 100 : 0 }
+ PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: false }
+ }
+ }
+ }
+}