aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicklistview/data
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-05-18 17:37:19 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-06-10 06:56:18 +0000
commiteb7db5934b453eea2946ed7ae9a188c44467cf23 (patch)
treebeca3748a6fab9dadd4c4cb9d191f8c146e070b4 /tests/auto/quick/qquicklistview/data
parentf12c07216e25f9a326000e45583b9d5216945ee7 (diff)
ObjectModel: add API for dynamic changes
Following the ListModel API: - object get(index) - append(object) - insert(int index, object) - move(int from, int to, int n) - remove(int index, int n) [ChangeLog][QtQml][ObjectModel] Added get(), append(), insert(), move() and remove() methods. Change-Id: I592e55b7c4c933a1100191bf5a9405944b347172 Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Diffstat (limited to 'tests/auto/quick/qquicklistview/data')
-rw-r--r--tests/auto/quick/qquicklistview/data/objectmodel.qml24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/data/objectmodel.qml b/tests/auto/quick/qquicklistview/data/objectmodel.qml
new file mode 100644
index 0000000000..5c23d64cd3
--- /dev/null
+++ b/tests/auto/quick/qquicklistview/data/objectmodel.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+import QtQml.Models 2.1
+
+ListView {
+ width: 360
+ height: 360
+ model: ObjectModel {
+ Rectangle {
+ width: 20
+ height: 20
+ color: "red"
+ }
+ Rectangle {
+ width: 20
+ height: 20
+ color: "green"
+ }
+ Rectangle {
+ width: 20
+ height: 20
+ color: "blue"
+ }
+ }
+}