aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2011-12-01 14:01:13 +1000
committerQt by Nokia <qt-info@nokia.com>2011-12-23 07:23:39 +0100
commit347f84e5aca9423536cb0cd7a2eafaf836a72212 (patch)
treecdb68529b37190be7f477d7775f8011d39080b36 /examples/declarative
parent932a195dbaae92ce87b98beca29a25c9b8d6cf5b (diff)
Minimize the number of objects created per item in VisualDataModel.
Derive from QDeclarativeContext and reference count the context object instead of parenting it to the context. Combined with a weak persistent v8 handle the allows the context object to be returned by javascript accessors instead of creating a new instance for every use. In addition to the efficiency advantages of creating fewer objects, routing all data access through a single object means that object can also persist data instead of just acting as a proxy. Change-Id: I107dc8c901f16f2a4b420ff1cbffa7a6be27de89 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'examples/declarative')
-rw-r--r--examples/declarative/modelviews/visualdatamodel/dragselection.qml2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/declarative/modelviews/visualdatamodel/dragselection.qml b/examples/declarative/modelviews/visualdatamodel/dragselection.qml
index afbea1ff94..edce2d5ac2 100644
--- a/examples/declarative/modelviews/visualdatamodel/dragselection.qml
+++ b/examples/declarative/modelviews/visualdatamodel/dragselection.qml
@@ -83,7 +83,7 @@ Item {
}
DropArea {
anchors.fill: parent
- onEntered: visualModel.items.move(selectedItems, 0, packageRoot.VisualDataModel.itemsIndex, selectedItems.count)
+ onEntered: selectedItems.move(0, visualModel.items.get(packageRoot.VisualDataModel.itemsIndex), selectedItems.count)
}
}
Item {