summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/jsondbcachinglistmodel/jsondbcachinglistmodel-bench.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/jsondbcachinglistmodel/jsondbcachinglistmodel-bench.cpp')
-rw-r--r--tests/benchmarks/jsondbcachinglistmodel/jsondbcachinglistmodel-bench.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/benchmarks/jsondbcachinglistmodel/jsondbcachinglistmodel-bench.cpp b/tests/benchmarks/jsondbcachinglistmodel/jsondbcachinglistmodel-bench.cpp
index 52d2117..d8c4f45 100644
--- a/tests/benchmarks/jsondbcachinglistmodel/jsondbcachinglistmodel-bench.cpp
+++ b/tests/benchmarks/jsondbcachinglistmodel/jsondbcachinglistmodel-bench.cpp
@@ -44,7 +44,7 @@
#include "jsondbcachinglistmodel-bench.h"
#include "../../shared/util.h"
-#include <QDeclarativeListReference>
+#include <QQmlListReference>
#include "json.h"
static const char dbfile[] = "dbFile-jsondb-cached-listmodel";
@@ -159,14 +159,14 @@ void JsonDbCachingListModelBench::initTestCase()
QAbstractListModel *JsonDbCachingListModelBench::createModel()
{
ModelData *newModel = new ModelData();
- newModel->engine = new QDeclarativeEngine();
+ newModel->engine = new QQmlEngine();
QString error;
if (!newModel->engine->importPlugin(mPluginPath, QString("QtJsonDb"), &error)) {
qDebug()<<"Unable to load the plugin :"<<error;
delete newModel->engine;
return 0;
}
- newModel->component = new QDeclarativeComponent(newModel->engine);
+ newModel->component = new QQmlComponent(newModel->engine);
newModel->component->setData("import QtQuick 2.0\nimport QtJsonDb 1.0 as JsonDb \n"
"JsonDb.JsonDbCachingListModel {signal callbackSignal(variant index, variant response); id: contactsModel; cacheSize: 200;}",
QUrl());
@@ -177,7 +177,7 @@ QAbstractListModel *JsonDbCachingListModelBench::createModel()
QObject::connect(newModel->model, SIGNAL(callbackSignal(QVariant, QVariant)),
this, SLOT(callbackSlot(QVariant, QVariant)));
- newModel->partitionComponent1 = new QDeclarativeComponent(newModel->engine);
+ newModel->partitionComponent1 = new QQmlComponent(newModel->engine);
newModel->partitionComponent1->setData("import QtQuick 2.0\nimport QtJsonDb 1.0 as JsonDb \n"
"JsonDb.Partition {name: \"com.nokia.shared.1\"}",
QUrl());
@@ -186,7 +186,7 @@ QAbstractListModel *JsonDbCachingListModelBench::createModel()
qDebug() << newModel->partitionComponent1->errors();
- newModel->partitionComponent2 = new QDeclarativeComponent(newModel->engine);
+ newModel->partitionComponent2 = new QQmlComponent(newModel->engine);
newModel->partitionComponent2->setData("import QtQuick 2.0\nimport QtJsonDb 1.0 as JsonDb \n"
"JsonDb.Partition {name: \"com.nokia.shared.2\"}",
QUrl());
@@ -194,7 +194,7 @@ QAbstractListModel *JsonDbCachingListModelBench::createModel()
if (newModel->partitionComponent2->isError())
qDebug() << newModel->partitionComponent2->errors();
- QDeclarativeListReference partitions(newModel->model, "partitions", newModel->engine);
+ QQmlListReference partitions(newModel->model, "partitions", newModel->engine);
partitions.append(newModel->partition1);
partitions.append(newModel->partition2);
@@ -248,7 +248,7 @@ void JsonDbCachingListModelBench::getIndex(int index)
const QString createString = QString("get(%1, function (error, response) {callbackSignal(error, response);});");
const QString getString = QString(createString).arg(index);
- QDeclarativeExpression expr(mModels.last()->engine->rootContext(), mModels.last()->model, getString);
+ QQmlExpression expr(mModels.last()->engine->rootContext(), mModels.last()->model, getString);
expr.evaluate().toInt();
if (!mCallbackReceived)