aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicklistview/data/emptymodel.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquicklistview/data/emptymodel.qml')
-rw-r--r--tests/auto/quick/qquicklistview/data/emptymodel.qml23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/data/emptymodel.qml b/tests/auto/quick/qquicklistview/data/emptymodel.qml
new file mode 100644
index 0000000000..16bcd3f9ae
--- /dev/null
+++ b/tests/auto/quick/qquicklistview/data/emptymodel.qml
@@ -0,0 +1,23 @@
+import QtQuick 2.0
+Rectangle {
+ ListModel {
+ id: model
+ ListElement { name: "hello"}
+ }
+ ListView {
+ id: list
+ model: model
+ delegate: Item {
+ }
+ }
+ function remove() {
+ model.remove(0)
+ isCurrentItemNull = list.currentItem === null //check no seg fault
+ }
+
+ function add() {
+ model.append({name: "hello"})
+ isCurrentItemNull = list.currentItem === null
+ }
+ property bool isCurrentItemNull
+}