summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorBogDan Vatra <bogdan.vatra.ford@kdab.com>2016-05-06 16:42:03 +0300
committerBogDan Vatra <bogdan@kdab.com>2016-05-09 08:35:59 +0000
commit5354c0098aa8e52c3ff5036a9d28ff1de126cf96 (patch)
tree08d90a677f3df0011c8de362e5c070a2b33d9612 /examples
parent4280d8e52a21fb7ab892c72c628cb8b5cd21f170 (diff)
Memory performance
Use a LRU Cache to keep the most m_cacheSize used items. Change-Id: I2c46153e4236b4ba354c0b45f0840b28da710366 Reviewed-by: Continuous Integration (KDAB) <build@kdab.com> Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/RemoteObjects/ModelViewClient/main.cpp3
-rw-r--r--examples/RemoteObjects/QMLModelViewClient/main.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/examples/RemoteObjects/ModelViewClient/main.cpp b/examples/RemoteObjects/ModelViewClient/main.cpp
index d32e857..33d5035 100644
--- a/examples/RemoteObjects/ModelViewClient/main.cpp
+++ b/examples/RemoteObjects/ModelViewClient/main.cpp
@@ -60,7 +60,8 @@ int main(int argc, char **argv)
QTreeView view;
view.setWindowTitle(QStringLiteral("RemoteView"));
view.resize(640,480);
- view.setModel(node.acquireModel(QStringLiteral("RemoteModel")));
+ QScopedPointer<QAbstractItemModelReplica> model(node.acquireModel(QStringLiteral("RemoteModel")));
+ view.setModel(model.data());
view.show();
return app.exec();
diff --git a/examples/RemoteObjects/QMLModelViewClient/main.cpp b/examples/RemoteObjects/QMLModelViewClient/main.cpp
index 827ebf8..5693125 100644
--- a/examples/RemoteObjects/QMLModelViewClient/main.cpp
+++ b/examples/RemoteObjects/QMLModelViewClient/main.cpp
@@ -56,7 +56,8 @@ int main(int argc, char *argv[])
QRemoteObjectNode node(QUrl(QStringLiteral("local:registry")));
QQmlApplicationEngine engine;
- engine.rootContext()->setContextProperty("remoteModel", node.acquireModel(QStringLiteral("RemoteModel")));
+ QScopedPointer<QAbstractItemModelReplica> model(node.acquireModel(QStringLiteral("RemoteModel")));
+ engine.rootContext()->setContextProperty("remoteModel", model.data());
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
return app.exec();