diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-05-18 17:37:19 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-06-10 06:56:18 +0000 |
commit | eb7db5934b453eea2946ed7ae9a188c44467cf23 (patch) | |
tree | beca3748a6fab9dadd4c4cb9d191f8c146e070b4 /tests/auto/quick/qquickrepeater/data | |
parent | f12c07216e25f9a326000e45583b9d5216945ee7 (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/qquickrepeater/data')
-rw-r--r-- | tests/auto/quick/qquickrepeater/data/objectmodel.qml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickrepeater/data/objectmodel.qml b/tests/auto/quick/qquickrepeater/data/objectmodel.qml new file mode 100644 index 0000000000..780f53e802 --- /dev/null +++ b/tests/auto/quick/qquickrepeater/data/objectmodel.qml @@ -0,0 +1,28 @@ +import QtQuick 2.0 +import QtQml.Models 2.1 + +Row { + width: 360 + height: 360 + + Repeater { + objectName: "repeater" + model: ObjectModel { + Rectangle { + width: 20 + height: 20 + color: "red" + } + Rectangle { + width: 20 + height: 20 + color: "green" + } + Rectangle { + width: 20 + height: 20 + color: "blue" + } + } + } +} |