diff options
62 files changed, 233 insertions, 233 deletions
diff --git a/modules/qt_jsondb.pri b/modules/qt_jsondb.pri index ffdf582..625462c 100644 --- a/modules/qt_jsondb.pri +++ b/modules/qt_jsondb.pri @@ -12,7 +12,7 @@ QT.jsondb.sources = $$QT_MODULE_BASE/src QT.jsondb.libs = $$QT_MODULE_LIB_BASE QT.jsondb.plugins = $$QT_MODULE_PLUGIN_BASE QT.jsondb.imports = $$QT_MODULE_IMPORT_BASE -QT.jsondb.depends = core network declarative +QT.jsondb.depends = core network qml QT_CONFIG += jsondb } diff --git a/modules/qt_jsondbcompat.pri b/modules/qt_jsondbcompat.pri index 0d11b8e..fbda4b3 100644 --- a/modules/qt_jsondbcompat.pri +++ b/modules/qt_jsondbcompat.pri @@ -12,7 +12,7 @@ QT.jsondbcompat.sources = $$QT_MODULE_BASE/src QT.jsondbcompat.libs = $$QT_MODULE_LIB_BASE QT.jsondbcompat.plugins = $$QT_MODULE_PLUGIN_BASE QT.jsondbcompat.imports = $$QT_MODULE_IMPORT_BASE -QT.jsondbcompat.depends = core network declarative +QT.jsondbcompat.depends = core network qml QT_CONFIG += jsondbcompat } diff --git a/src/daemon/daemon.pro b/src/daemon/daemon.pro index c9f998a..00bcc11 100644 --- a/src/daemon/daemon.pro +++ b/src/daemon/daemon.pro @@ -5,7 +5,7 @@ INSTALLS += target LIBS += -L$$QT.jsondb.libs -QT = core network declarative +QT = core network qml mac:CONFIG -= app_bundle diff --git a/src/imports/jsondb-listmodel/jsondb-listmodel.h b/src/imports/jsondb-listmodel/jsondb-listmodel.h index 14bce90..c888c62 100644 --- a/src/imports/jsondb-listmodel/jsondb-listmodel.h +++ b/src/imports/jsondb-listmodel/jsondb-listmodel.h @@ -48,7 +48,7 @@ #include <QSet> #include <QSharedDataPointer> #include <QStringList> -#include <QDeclarativeParserStatus> +#include <QQmlParserStatus> #include <QJSValue> #include <QScopedPointer> @@ -74,10 +74,10 @@ bool operator <(const JsonDbSortKey &a, const JsonDbSortKey &b); class JsonDbListModelPrivate; -class JsonDbListModel : public QAbstractListModel, public QDeclarativeParserStatus +class JsonDbListModel : public QAbstractListModel, public QQmlParserStatus { Q_OBJECT - Q_INTERFACES(QDeclarativeParserStatus) + Q_INTERFACES(QQmlParserStatus) public: JsonDbListModel(QObject *parent = 0); virtual ~JsonDbListModel(); diff --git a/src/imports/jsondb-listmodel/jsondb-listmodel.pro b/src/imports/jsondb-listmodel/jsondb-listmodel.pro index a6e7759..b881c12 100644 --- a/src/imports/jsondb-listmodel/jsondb-listmodel.pro +++ b/src/imports/jsondb-listmodel/jsondb-listmodel.pro @@ -3,7 +3,7 @@ TARGETPATH = QtAddOn/JsonDb include(../qimportbase.pri) -QT += network declarative jsondbcompat-private +QT += network qml jsondbcompat-private DESTDIR = $$QT.jsondb.imports/$$TARGETPATH target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH diff --git a/src/imports/jsondb-listmodel/plugin.cpp b/src/imports/jsondb-listmodel/plugin.cpp index 6b86156..3bd5763 100644 --- a/src/imports/jsondb-listmodel/plugin.cpp +++ b/src/imports/jsondb-listmodel/plugin.cpp @@ -48,7 +48,7 @@ Q_EXPORT_STATIC_PLUGIN(JsonDbListModelPlugin) Q_EXPORT_PLUGIN2(jsondblistmodelplugin, JsonDbListModelPlugin) -void JsonDbListModelPlugin::initializeEngine(QDeclarativeEngine *engine, const char *uri) +void JsonDbListModelPlugin::initializeEngine(QQmlEngine *engine, const char *uri) { Q_UNUSED(engine); Q_UNUSED(uri); diff --git a/src/imports/jsondb-listmodel/plugin.h b/src/imports/jsondb-listmodel/plugin.h index 44a459f..68b28ab 100644 --- a/src/imports/jsondb-listmodel/plugin.h +++ b/src/imports/jsondb-listmodel/plugin.h @@ -42,16 +42,16 @@ #ifndef JSONDB_PLUGIN_H #define JSONDB_PLUGIN_H -#include <QDeclarativeExtensionPlugin> -#include <QtDeclarative/qdeclarative.h> +#include <QQmlExtensionPlugin> +#include <QtQml/qqml.h> -class JsonDbListModelPlugin : public QDeclarativeExtensionPlugin +class JsonDbListModelPlugin : public QQmlExtensionPlugin { Q_OBJECT public: - void initializeEngine(QDeclarativeEngine *engine, const char *uri); + void initializeEngine(QQmlEngine *engine, const char *uri); void registerTypes(const char *uri); }; diff --git a/src/imports/jsondb/jsondatabase.cpp b/src/imports/jsondb/jsondatabase.cpp index 314598f..491fe85 100644 --- a/src/imports/jsondb/jsondatabase.cpp +++ b/src/imports/jsondb/jsondatabase.cpp @@ -43,7 +43,7 @@ #include "jsondbpartition.h" #include "jsondb-object.h" #include <QJSEngine> -#include <QDeclarativeEngine> +#include <QQmlEngine> #include <qdebug.h> QT_BEGIN_NAMESPACE_JSONDB @@ -100,7 +100,7 @@ JsonDatabase::~JsonDatabase() JsonDbPartition* JsonDatabase::partition(const QString &partitionName) { JsonDbPartition* newPartition = new JsonDbPartition(partitionName); - QDeclarativeEngine::setObjectOwnership(newPartition, QDeclarativeEngine::JavaScriptOwnership); + QQmlEngine::setObjectOwnership(newPartition, QQmlEngine::JavaScriptOwnership); return newPartition; } diff --git a/src/imports/jsondb/jsondb.pro b/src/imports/jsondb/jsondb.pro index 49124a3..adb7ce2 100644 --- a/src/imports/jsondb/jsondb.pro +++ b/src/imports/jsondb/jsondb.pro @@ -3,7 +3,7 @@ TARGETPATH = QtJsonDb include(../qimportbase.pri) -QT += network declarative jsondbcompat-private +QT += network qml jsondbcompat-private DESTDIR = $$QT.jsondbcompat.imports/$$TARGETPATH target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH diff --git a/src/imports/jsondb/jsondbcachinglistmodel.cpp b/src/imports/jsondb/jsondbcachinglistmodel.cpp index 1fe3839..c34617c 100644 --- a/src/imports/jsondb/jsondbcachinglistmodel.cpp +++ b/src/imports/jsondb/jsondbcachinglistmodel.cpp @@ -1017,7 +1017,7 @@ void JsonDbCachingListModelPrivate::_q_verifyDefaultIndexType(int index) } } -void JsonDbCachingListModelPrivate::partitions_append(QDeclarativeListProperty<JsonDbPartition> *p, JsonDbPartition *v) +void JsonDbCachingListModelPrivate::partitions_append(QQmlListProperty<JsonDbPartition> *p, JsonDbPartition *v) { JsonDbCachingListModel *q = qobject_cast<JsonDbCachingListModel *>(p->object); JsonDbCachingListModelPrivate *pThis = (q) ? q->d_func() : 0; @@ -1037,7 +1037,7 @@ void JsonDbCachingListModelPrivate::partitions_append(QDeclarativeListProperty<J } } -int JsonDbCachingListModelPrivate::partitions_count(QDeclarativeListProperty<JsonDbPartition> *p) +int JsonDbCachingListModelPrivate::partitions_count(QQmlListProperty<JsonDbPartition> *p) { JsonDbCachingListModel *q = qobject_cast<JsonDbCachingListModel *>(p->object); JsonDbCachingListModelPrivate *pThis = (q) ? q->d_func() : 0; @@ -1047,7 +1047,7 @@ int JsonDbCachingListModelPrivate::partitions_count(QDeclarativeListProperty<Jso return 0; } -JsonDbPartition* JsonDbCachingListModelPrivate::partitions_at(QDeclarativeListProperty<JsonDbPartition> *p, int idx) +JsonDbPartition* JsonDbCachingListModelPrivate::partitions_at(QQmlListProperty<JsonDbPartition> *p, int idx) { JsonDbCachingListModel *q = qobject_cast<JsonDbCachingListModel *>(p->object); JsonDbCachingListModelPrivate *pThis = (q) ? q->d_func() : 0; @@ -1057,7 +1057,7 @@ JsonDbPartition* JsonDbCachingListModelPrivate::partitions_at(QDeclarativeListPr return 0; } -void JsonDbCachingListModelPrivate::partitions_clear(QDeclarativeListProperty<JsonDbPartition> *p) +void JsonDbCachingListModelPrivate::partitions_clear(QQmlListProperty<JsonDbPartition> *p) { JsonDbCachingListModel *q = qobject_cast<JsonDbCachingListModel *>(p->object); JsonDbCachingListModelPrivate *pThis = (q) ? q->d_func() : 0; @@ -1362,9 +1362,9 @@ void JsonDbCachingListModel::partitionNameChanged(const QString &partitionName) */ -QDeclarativeListProperty<JsonDbPartition> JsonDbCachingListModel::partitions() +QQmlListProperty<JsonDbPartition> JsonDbCachingListModel::partitions() { - return QDeclarativeListProperty<JsonDbPartition>(this, 0 + return QQmlListProperty<JsonDbPartition>(this, 0 , &JsonDbCachingListModelPrivate::partitions_append , &JsonDbCachingListModelPrivate::partitions_count , &JsonDbCachingListModelPrivate::partitions_at diff --git a/src/imports/jsondb/jsondbcachinglistmodel.h b/src/imports/jsondb/jsondbcachinglistmodel.h index 1ef2204..76b0311 100644 --- a/src/imports/jsondb/jsondbcachinglistmodel.h +++ b/src/imports/jsondb/jsondbcachinglistmodel.h @@ -48,8 +48,8 @@ #include <QSet> #include <QSharedDataPointer> #include <QStringList> -#include <QDeclarativeParserStatus> -#include <QDeclarativeListProperty> +#include <QQmlParserStatus> +#include <QQmlListProperty> #include <QJSValue> #include <QScopedPointer> @@ -61,10 +61,10 @@ QT_BEGIN_NAMESPACE_JSONDB class JsonDbCachingListModelPrivate; class JsonDbPartition; -class JsonDbCachingListModel : public QAbstractListModel, public QDeclarativeParserStatus +class JsonDbCachingListModel : public QAbstractListModel, public QQmlParserStatus { Q_OBJECT - Q_INTERFACES(QDeclarativeParserStatus) + Q_INTERFACES(QQmlParserStatus) Q_ENUMS(State) public: enum State { None, Querying, Ready, Error }; @@ -78,7 +78,7 @@ public: Q_PROPERTY(int rowCount READ rowCount NOTIFY rowCountChanged) Q_PROPERTY(QVariant roleNames READ scriptableRoleNames WRITE setScriptableRoleNames) Q_PROPERTY(int cacheSize READ cacheSize WRITE setCacheSize) - Q_PROPERTY(QDeclarativeListProperty<JsonDbPartition> partitions READ partitions) + Q_PROPERTY(QQmlListProperty<JsonDbPartition> partitions READ partitions) Q_PROPERTY(QVariantMap error READ error NOTIFY errorChanged) virtual void classBegin(); @@ -93,7 +93,7 @@ public: QString query() const; void setQuery(const QString &newQuery); - QDeclarativeListProperty<JsonDbPartition> partitions(); + QQmlListProperty<JsonDbPartition> partitions(); int cacheSize() const; void setCacheSize(int newCacheSize); diff --git a/src/imports/jsondb/jsondbcachinglistmodel_p.h b/src/imports/jsondb/jsondbcachinglistmodel_p.h index 393f753..bf949dc 100644 --- a/src/imports/jsondb/jsondbcachinglistmodel_p.h +++ b/src/imports/jsondb/jsondbcachinglistmodel_p.h @@ -181,10 +181,10 @@ public: void _q_dbNotifyErrorResponse(int id, int code, const QString &message); void _q_verifyDefaultIndexType(int index); - static void partitions_append(QDeclarativeListProperty<JsonDbPartition> *p, JsonDbPartition *v); - static int partitions_count(QDeclarativeListProperty<JsonDbPartition> *p); - static JsonDbPartition* partitions_at(QDeclarativeListProperty<JsonDbPartition> *p, int idx); - static void partitions_clear(QDeclarativeListProperty<JsonDbPartition> *p); + static void partitions_append(QQmlListProperty<JsonDbPartition> *p, JsonDbPartition *v); + static int partitions_count(QQmlListProperty<JsonDbPartition> *p); + static JsonDbPartition* partitions_at(QQmlListProperty<JsonDbPartition> *p, int idx); + static void partitions_clear(QQmlListProperty<JsonDbPartition> *p); }; diff --git a/src/imports/jsondb/jsondbchangessinceobject.h b/src/imports/jsondb/jsondbchangessinceobject.h index 46e0ca9..22649af 100644 --- a/src/imports/jsondb/jsondbchangessinceobject.h +++ b/src/imports/jsondb/jsondbchangessinceobject.h @@ -46,8 +46,8 @@ #include <QVariant> #include <QPointer> #include <QJSValue> -#include <QDeclarativeParserStatus> -#include <QDeclarativeListProperty> +#include <QQmlParserStatus> +#include <QQmlListProperty> #include "jsondb-client.h" QT_BEGIN_NAMESPACE_JSONDB @@ -55,10 +55,10 @@ QT_BEGIN_NAMESPACE_JSONDB class JsonDbPartition; class JsonDbPartitionPrivate; -class JsonDbChangesSinceObject : public QObject, public QDeclarativeParserStatus +class JsonDbChangesSinceObject : public QObject, public QQmlParserStatus { Q_OBJECT - Q_INTERFACES(QDeclarativeParserStatus) + Q_INTERFACES(QQmlParserStatus) public: Q_ENUMS(Status) diff --git a/src/imports/jsondb/jsondblistmodel.h b/src/imports/jsondb/jsondblistmodel.h index 3e36a0c..36494e6 100644 --- a/src/imports/jsondb/jsondblistmodel.h +++ b/src/imports/jsondb/jsondblistmodel.h @@ -48,7 +48,7 @@ #include <QSet> #include <QSharedDataPointer> #include <QStringList> -#include <QDeclarativeParserStatus> +#include <QQmlParserStatus> #include <QJSValue> #include <QScopedPointer> @@ -75,10 +75,10 @@ bool operator <(const JsonDbSortKey &a, const JsonDbSortKey &b); class JsonDbListModelPrivate; class JsonDbPartition; -class JsonDbListModel : public QAbstractListModel, public QDeclarativeParserStatus +class JsonDbListModel : public QAbstractListModel, public QQmlParserStatus { Q_OBJECT - Q_INTERFACES(QDeclarativeParserStatus) + Q_INTERFACES(QQmlParserStatus) public: JsonDbListModel(QObject *parent = 0); virtual ~JsonDbListModel(); diff --git a/src/imports/jsondb/jsondbnotification.h b/src/imports/jsondb/jsondbnotification.h index 51af009..3957cd5 100644 --- a/src/imports/jsondb/jsondbnotification.h +++ b/src/imports/jsondb/jsondbnotification.h @@ -46,8 +46,8 @@ #include <QVariant> #include <QPointer> #include <QJSValue> -#include <QDeclarativeParserStatus> -#include <QDeclarativeListProperty> +#include <QQmlParserStatus> +#include <QQmlListProperty> #include "jsondb-client.h" QT_BEGIN_NAMESPACE_JSONDB @@ -55,10 +55,10 @@ QT_BEGIN_NAMESPACE_JSONDB class JsonDbPartition; class JsonDbPartitionPrivate; -class JsonDbNotify : public QObject, public QDeclarativeParserStatus +class JsonDbNotify : public QObject, public QQmlParserStatus { Q_OBJECT - Q_INTERFACES(QDeclarativeParserStatus) + Q_INTERFACES(QQmlParserStatus) public: Q_ENUMS(Actions) diff --git a/src/imports/jsondb/jsondbpartition.cpp b/src/imports/jsondb/jsondbpartition.cpp index b98e8fc..2302317 100644 --- a/src/imports/jsondb/jsondbpartition.cpp +++ b/src/imports/jsondb/jsondbpartition.cpp @@ -413,7 +413,7 @@ JsonDbNotify* JsonDbPartition::createNotification(const QString &query) notify->setPartition(this); notify->setQuery(query); notify->componentComplete(); - QDeclarativeEngine::setObjectOwnership(notify, QDeclarativeEngine::JavaScriptOwnership); + QQmlEngine::setObjectOwnership(notify, QQmlEngine::JavaScriptOwnership); return notify; } @@ -453,7 +453,7 @@ JsonDbQueryObject* JsonDbPartition::createQuery(const QString &query, int limit, queryObject->setLimit(limit); queryObject->setPartition(this); queryObject->componentComplete(); - QDeclarativeEngine::setObjectOwnership(queryObject, QDeclarativeEngine::JavaScriptOwnership); + QQmlEngine::setObjectOwnership(queryObject, QQmlEngine::JavaScriptOwnership); return queryObject; } @@ -492,13 +492,13 @@ JsonDbChangesSinceObject* JsonDbPartition::createChangesSince(int stateNumber, c changesSinceObject->setStateNumber(stateNumber); changesSinceObject->setPartition(this); changesSinceObject->componentComplete(); - QDeclarativeEngine::setObjectOwnership(changesSinceObject, QDeclarativeEngine::JavaScriptOwnership); + QQmlEngine::setObjectOwnership(changesSinceObject, QQmlEngine::JavaScriptOwnership); return changesSinceObject; } -QDeclarativeListProperty<QObject> JsonDbPartition::childElements() +QQmlListProperty<QObject> JsonDbPartition::childElements() { - return QDeclarativeListProperty<QObject>(this, childQMLElements); + return QQmlListProperty<QObject>(this, childQMLElements); } void JsonDbPartition::updateNotification(JsonDbNotify *notify) diff --git a/src/imports/jsondb/jsondbpartition.h b/src/imports/jsondb/jsondbpartition.h index 9dc853c..1c831c2 100644 --- a/src/imports/jsondb/jsondbpartition.h +++ b/src/imports/jsondb/jsondbpartition.h @@ -48,7 +48,7 @@ #include <QPointer> #include <QJSValue> #include <QJSEngine> -#include <QDeclarativeListProperty> +#include <QQmlListProperty> #include "jsondb-client.h" @@ -94,9 +94,9 @@ public: QString name() const; void setName(const QString &partitionName); - Q_PROPERTY(QDeclarativeListProperty<QObject> childElements READ childElements) + Q_PROPERTY(QQmlListProperty<QObject> childElements READ childElements) Q_CLASSINFO("DefaultProperty", "childElements") - QDeclarativeListProperty<QObject> childElements(); + QQmlListProperty<QObject> childElements(); Q_SIGNALS: void nameChanged(const QString &partitionName); diff --git a/src/imports/jsondb/jsondbqueryobject.h b/src/imports/jsondb/jsondbqueryobject.h index a9d1497..d629d26 100644 --- a/src/imports/jsondb/jsondbqueryobject.h +++ b/src/imports/jsondb/jsondbqueryobject.h @@ -46,8 +46,8 @@ #include <QVariant> #include <QPointer> #include <QJSValue> -#include <QDeclarativeParserStatus> -#include <QDeclarativeListProperty> +#include <QQmlParserStatus> +#include <QQmlListProperty> #include "jsondb-client.h" QT_BEGIN_NAMESPACE_JSONDB @@ -55,10 +55,10 @@ QT_BEGIN_NAMESPACE_JSONDB class JsonDbPartition; class JsonDbPartitionPrivate; -class JsonDbQueryObject : public QObject, public QDeclarativeParserStatus +class JsonDbQueryObject : public QObject, public QQmlParserStatus { Q_OBJECT - Q_INTERFACES(QDeclarativeParserStatus) + Q_INTERFACES(QQmlParserStatus) public: Q_ENUMS(Status) diff --git a/src/imports/jsondb/jsondbsortinglistmodel.cpp b/src/imports/jsondb/jsondbsortinglistmodel.cpp index 5ee3367..c70b19e 100644 --- a/src/imports/jsondb/jsondbsortinglistmodel.cpp +++ b/src/imports/jsondb/jsondbsortinglistmodel.cpp @@ -552,7 +552,7 @@ void JsonDbSortingListModelPrivate::_q_dbNotifyErrorResponse(int id, int code, c qWarning() << QString("JsonDbSortingListModel Notification error: %1 %2").arg(code).arg(message); } -void JsonDbSortingListModelPrivate::partitions_append(QDeclarativeListProperty<JsonDbPartition> *p, JsonDbPartition *v) +void JsonDbSortingListModelPrivate::partitions_append(QQmlListProperty<JsonDbPartition> *p, JsonDbPartition *v) { JsonDbSortingListModel *q = qobject_cast<JsonDbSortingListModel *>(p->object); JsonDbSortingListModelPrivate *pThis = (q) ? q->d_func() : 0; @@ -569,7 +569,7 @@ void JsonDbSortingListModelPrivate::partitions_append(QDeclarativeListProperty<J } } -int JsonDbSortingListModelPrivate::partitions_count(QDeclarativeListProperty<JsonDbPartition> *p) +int JsonDbSortingListModelPrivate::partitions_count(QQmlListProperty<JsonDbPartition> *p) { JsonDbSortingListModel *q = qobject_cast<JsonDbSortingListModel *>(p->object); JsonDbSortingListModelPrivate *pThis = (q) ? q->d_func() : 0; @@ -579,7 +579,7 @@ int JsonDbSortingListModelPrivate::partitions_count(QDeclarativeListProperty<Jso return 0; } -JsonDbPartition* JsonDbSortingListModelPrivate::partitions_at(QDeclarativeListProperty<JsonDbPartition> *p, int idx) +JsonDbPartition* JsonDbSortingListModelPrivate::partitions_at(QQmlListProperty<JsonDbPartition> *p, int idx) { JsonDbSortingListModel *q = qobject_cast<JsonDbSortingListModel *>(p->object); JsonDbSortingListModelPrivate *pThis = (q) ? q->d_func() : 0; @@ -589,7 +589,7 @@ JsonDbPartition* JsonDbSortingListModelPrivate::partitions_at(QDeclarativeListPr return 0; } -void JsonDbSortingListModelPrivate::partitions_clear(QDeclarativeListProperty<JsonDbPartition> *p) +void JsonDbSortingListModelPrivate::partitions_clear(QQmlListProperty<JsonDbPartition> *p) { JsonDbSortingListModel *q = qobject_cast<JsonDbSortingListModel *>(p->object); JsonDbSortingListModelPrivate *pThis = (q) ? q->d_func() : 0; @@ -896,9 +896,9 @@ void JsonDbSortingListModel::partitionNameChanged(const QString &partitionName) */ -QDeclarativeListProperty<JsonDbPartition> JsonDbSortingListModel::partitions() +QQmlListProperty<JsonDbPartition> JsonDbSortingListModel::partitions() { - return QDeclarativeListProperty<JsonDbPartition>(this, 0 + return QQmlListProperty<JsonDbPartition>(this, 0 , &JsonDbSortingListModelPrivate::partitions_append , &JsonDbSortingListModelPrivate::partitions_count , &JsonDbSortingListModelPrivate::partitions_at diff --git a/src/imports/jsondb/jsondbsortinglistmodel.h b/src/imports/jsondb/jsondbsortinglistmodel.h index f13dc89..99ef405 100644 --- a/src/imports/jsondb/jsondbsortinglistmodel.h +++ b/src/imports/jsondb/jsondbsortinglistmodel.h @@ -48,8 +48,8 @@ #include <QSet> #include <QSharedDataPointer> #include <QStringList> -#include <QDeclarativeParserStatus> -#include <QDeclarativeListProperty> +#include <QQmlParserStatus> +#include <QQmlListProperty> #include <QJSValue> #include <QScopedPointer> @@ -61,10 +61,10 @@ QT_BEGIN_NAMESPACE_JSONDB class JsonDbSortingListModelPrivate; class JsonDbPartition; -class JsonDbSortingListModel : public QAbstractListModel, public QDeclarativeParserStatus +class JsonDbSortingListModel : public QAbstractListModel, public QQmlParserStatus { Q_OBJECT - Q_INTERFACES(QDeclarativeParserStatus) + Q_INTERFACES(QQmlParserStatus) Q_ENUMS(State) public: enum State { None, Querying, Ready }; @@ -80,7 +80,7 @@ public: Q_PROPERTY(int queryLimit READ queryLimit WRITE setQueryLimit) Q_PROPERTY(bool overflow READ overflow) - Q_PROPERTY(QDeclarativeListProperty<JsonDbPartition> partitions READ partitions) + Q_PROPERTY(QQmlListProperty<JsonDbPartition> partitions READ partitions) virtual void classBegin(); virtual void componentComplete(); @@ -94,7 +94,7 @@ public: QString query() const; void setQuery(const QString &newQuery); - QDeclarativeListProperty<JsonDbPartition> partitions(); + QQmlListProperty<JsonDbPartition> partitions(); int queryLimit() const; void setQueryLimit(int newQueryLimit); diff --git a/src/imports/jsondb/jsondbsortinglistmodel_p.h b/src/imports/jsondb/jsondbsortinglistmodel_p.h index 1d50384..0cd45d0 100644 --- a/src/imports/jsondb/jsondbsortinglistmodel_p.h +++ b/src/imports/jsondb/jsondbsortinglistmodel_p.h @@ -136,10 +136,10 @@ public: void _q_dbNotifyReadyResponse(int id, const QVariant &result); void _q_dbNotifyErrorResponse(int id, int code, const QString &message); - static void partitions_append(QDeclarativeListProperty<JsonDbPartition> *p, JsonDbPartition *v); - static int partitions_count(QDeclarativeListProperty<JsonDbPartition> *p); - static JsonDbPartition* partitions_at(QDeclarativeListProperty<JsonDbPartition> *p, int idx); - static void partitions_clear(QDeclarativeListProperty<JsonDbPartition> *p); + static void partitions_append(QQmlListProperty<JsonDbPartition> *p, JsonDbPartition *v); + static int partitions_count(QQmlListProperty<JsonDbPartition> *p); + static JsonDbPartition* partitions_at(QQmlListProperty<JsonDbPartition> *p, int idx); + static void partitions_clear(QQmlListProperty<JsonDbPartition> *p); }; diff --git a/src/imports/jsondb/plugin.cpp b/src/imports/jsondb/plugin.cpp index a0afc62..3264b26 100644 --- a/src/imports/jsondb/plugin.cpp +++ b/src/imports/jsondb/plugin.cpp @@ -53,9 +53,9 @@ QT_USE_NAMESPACE_JSONDB Q_EXPORT_PLUGIN2(jsondbplugin, JsonDbPlugin) -QDeclarativeEngine *g_declEngine = 0; +QQmlEngine *g_declEngine = 0; -static QObject *jsondb_new_module_api_provider(QDeclarativeEngine *engine, QJSEngine *scriptEngine) +static QObject *jsondb_new_module_api_provider(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine) Q_UNUSED(scriptEngine) @@ -64,7 +64,7 @@ static QObject *jsondb_new_module_api_provider(QDeclarativeEngine *engine, QJSEn return database; } -void JsonDbPlugin::initializeEngine(QDeclarativeEngine *engine, const char *uri) +void JsonDbPlugin::initializeEngine(QQmlEngine *engine, const char *uri) { Q_UNUSED(uri); g_declEngine = engine; diff --git a/src/imports/jsondb/plugin.h b/src/imports/jsondb/plugin.h index c3ed212..bc6b03a 100644 --- a/src/imports/jsondb/plugin.h +++ b/src/imports/jsondb/plugin.h @@ -42,17 +42,17 @@ #ifndef JSONDB_PLUGIN_H #define JSONDB_PLUGIN_H -#include <QDeclarativeExtensionPlugin> -#include <QDeclarativeEngine> -#include <QtDeclarative/qdeclarative.h> +#include <QQmlExtensionPlugin> +#include <QQmlEngine> +#include <QtQml/qqml.h> -extern QDeclarativeEngine *g_declEngine; +extern QQmlEngine *g_declEngine; -class JsonDbPlugin : public QDeclarativeExtensionPlugin +class JsonDbPlugin : public QQmlExtensionPlugin { Q_OBJECT public: - void initializeEngine(QDeclarativeEngine *engine, const char *uri); + void initializeEngine(QQmlEngine *engine, const char *uri); void registerTypes(const char *uri); }; diff --git a/tests/auto/accesscontrol/accesscontrol.pro b/tests/auto/accesscontrol/accesscontrol.pro index 6f1f0bf..e15c1c6 100644 --- a/tests/auto/accesscontrol/accesscontrol.pro +++ b/tests/auto/accesscontrol/accesscontrol.pro @@ -1,7 +1,7 @@ TARGET = tst_accesscontrol CONFIG += debug -QT = network declarative testlib +QT = network qml testlib CONFIG -= app_bundle CONFIG += testcase diff --git a/tests/auto/daemon/daemon.pro b/tests/auto/daemon/daemon.pro index 3e8a0e1..ec251ea 100644 --- a/tests/auto/daemon/daemon.pro +++ b/tests/auto/daemon/daemon.pro @@ -1,7 +1,7 @@ TARGET = tst_daemon CONFIG += debug -QT = network declarative testlib +QT = network qml testlib CONFIG -= app_bundle CONFIG += testcase diff --git a/tests/auto/jsondb-listmodel/jsondb-listmodel.pro b/tests/auto/jsondb-listmodel/jsondb-listmodel.pro index b7c19aa..07d4eaf 100644 --- a/tests/auto/jsondb-listmodel/jsondb-listmodel.pro +++ b/tests/auto/jsondb-listmodel/jsondb-listmodel.pro @@ -3,7 +3,7 @@ TARGET = tst_jsondb-listmodel DEPENDPATH += . INCLUDEPATH += . -QT = core network testlib gui declarative jsondbcompat-private +QT = core network testlib gui qml jsondbcompat-private CONFIG -= app_bundle CONFIG += testcase diff --git a/tests/auto/jsondb-listmodel/test-jsondb-listmodel.cpp b/tests/auto/jsondb-listmodel/test-jsondb-listmodel.cpp index e2dffe6..2ac83cd 100644 --- a/tests/auto/jsondb-listmodel/test-jsondb-listmodel.cpp +++ b/tests/auto/jsondb-listmodel/test-jsondb-listmodel.cpp @@ -44,9 +44,9 @@ #include "test-jsondb-listmodel.h" #include "../../shared/util.h" -#include <QDeclarativeEngine> -#include <QDeclarativeComponent> -#include <QDeclarativeContext> +#include <QQmlEngine> +#include <QQmlComponent> +#include <QQmlContext> #include <QDir> #include "json.h" @@ -129,7 +129,7 @@ void TestJsonDbListModel::initTestCase() connect( mClient, SIGNAL(error(int, int, const QString&)), this, SLOT(error(int, int, const QString&))); - QDeclarativeEngine *engine = new QDeclarativeEngine(); + QQmlEngine *engine = new QQmlEngine(); QStringList pluginPaths = engine->importPathList(); for (int i=0; (i<pluginPaths.count() && mPluginPath.isEmpty()); i++) { QDir dir(pluginPaths[i]+"/QtAddOn/JsonDb"); @@ -150,14 +150,14 @@ void TestJsonDbListModel::initTestCase() JsonDbListModel *TestJsonDbListModel::createModel() { ModelData *newModel = new ModelData(); - newModel->engine = new QDeclarativeEngine(); + newModel->engine = new QQmlEngine(); QString error; if (!newModel->engine->importPlugin(mPluginPath, QString("QtAddOn.JsonDb"), &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 QtAddOn.JsonDb 1.0 \n JsonDbListModel {id: contactsModel}", QUrl()); newModel->model = newModel->component->create(); if (newModel->component->isError()) diff --git a/tests/auto/jsondb-listmodel/test-jsondb-listmodel.h b/tests/auto/jsondb-listmodel/test-jsondb-listmodel.h index 8054949..9681304 100644 --- a/tests/auto/jsondb-listmodel/test-jsondb-listmodel.h +++ b/tests/auto/jsondb-listmodel/test-jsondb-listmodel.h @@ -58,8 +58,8 @@ #include "clientwrapper.h" QT_BEGIN_NAMESPACE -class QDeclarativeEngine; -class QDeclarativeComponent; +class QQmlEngine; +class QQmlComponent; QT_END_NAMESPACE QT_USE_NAMESPACE_JSONDB @@ -70,8 +70,8 @@ class ModelData { public: ModelData(); ~ModelData(); - QDeclarativeEngine *engine; - QDeclarativeComponent *component; + QQmlEngine *engine; + QQmlComponent *component; QObject *model; }; diff --git a/tests/auto/jsondbcachinglistmodel/jsondbcachinglistmodel.pro b/tests/auto/jsondbcachinglistmodel/jsondbcachinglistmodel.pro index 7c07f7a..eff7faa 100644 --- a/tests/auto/jsondbcachinglistmodel/jsondbcachinglistmodel.pro +++ b/tests/auto/jsondbcachinglistmodel/jsondbcachinglistmodel.pro @@ -3,7 +3,7 @@ TARGET = tst_jsondbcachinglistmodel DEPENDPATH += . INCLUDEPATH += . -QT = core network testlib gui declarative jsondbcompat-private +QT = core network testlib gui qml jsondbcompat-private CONFIG -= app_bundle CONFIG += testcase diff --git a/tests/auto/jsondbcachinglistmodel/testjsondbcachinglistmodel.cpp b/tests/auto/jsondbcachinglistmodel/testjsondbcachinglistmodel.cpp index a363e5e..0438ba0 100644 --- a/tests/auto/jsondbcachinglistmodel/testjsondbcachinglistmodel.cpp +++ b/tests/auto/jsondbcachinglistmodel/testjsondbcachinglistmodel.cpp @@ -44,7 +44,7 @@ #include "testjsondbcachinglistmodel.h" #include "../../shared/util.h" -#include <QDeclarativeListReference> +#include <QQmlListReference> #include "json.h" static const char dbfile[] = "dbFile-jsondb-cached-listmodel"; @@ -165,14 +165,14 @@ void TestJsonDbCachingListModel::initTestCase() QAbstractListModel *TestJsonDbCachingListModel::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()); @@ -183,7 +183,7 @@ QAbstractListModel *TestJsonDbCachingListModel::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()); @@ -192,7 +192,7 @@ QAbstractListModel *TestJsonDbCachingListModel::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()); @@ -200,7 +200,7 @@ QAbstractListModel *TestJsonDbCachingListModel::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); @@ -245,7 +245,7 @@ void TestJsonDbCachingListModel::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) diff --git a/tests/auto/jsondbcachinglistmodel/testjsondbcachinglistmodel.h b/tests/auto/jsondbcachinglistmodel/testjsondbcachinglistmodel.h index c0e596f..695efaf 100644 --- a/tests/auto/jsondbcachinglistmodel/testjsondbcachinglistmodel.h +++ b/tests/auto/jsondbcachinglistmodel/testjsondbcachinglistmodel.h @@ -59,8 +59,8 @@ #include "../../shared/qmltestutil.h" QT_BEGIN_NAMESPACE -class QDeclarativeEngine; -class QDeclarativeComponent; +class QQmlEngine; +class QQmlComponent; QT_END_NAMESPACE QT_USE_NAMESPACE_JSONDB @@ -71,10 +71,10 @@ class ModelData { public: ModelData(); ~ModelData(); - QDeclarativeEngine *engine; - QDeclarativeComponent *component; - QDeclarativeComponent *partitionComponent1; - QDeclarativeComponent *partitionComponent2; + QQmlEngine *engine; + QQmlComponent *component; + QQmlComponent *partitionComponent1; + QQmlComponent *partitionComponent2; QObject *model; QObject *partition1; QObject *partition2; diff --git a/tests/auto/jsondbchangessinceobject/jsondbchangessinceobject.pro b/tests/auto/jsondbchangessinceobject/jsondbchangessinceobject.pro index df0d53d..cb94df5 100644 --- a/tests/auto/jsondbchangessinceobject/jsondbchangessinceobject.pro +++ b/tests/auto/jsondbchangessinceobject/jsondbchangessinceobject.pro @@ -3,7 +3,7 @@ TARGET = tst_jsondbchangessinceobject DEPENDPATH += . INCLUDEPATH += . -QT = core network testlib gui declarative jsondbcompat-private +QT = core network testlib gui qml jsondbcompat-private CONFIG -= app_bundle CONFIG += testcase diff --git a/tests/auto/jsondbchangessinceobject/testjsondbchangessinceobject.cpp b/tests/auto/jsondbchangessinceobject/testjsondbchangessinceobject.cpp index 10dcb26..6e3f467 100644 --- a/tests/auto/jsondbchangessinceobject/testjsondbchangessinceobject.cpp +++ b/tests/auto/jsondbchangessinceobject/testjsondbchangessinceobject.cpp @@ -126,14 +126,14 @@ void TestJsonDbChangesSinceObject::initTestCase() ComponentData *TestJsonDbChangesSinceObject::createComponent() { ComponentData *componentData = new ComponentData(); - componentData->engine = new QDeclarativeEngine(); + componentData->engine = new QQmlEngine(); QString error; if (!componentData->engine->importPlugin(mPluginPath, QString("QtJsonDb"), &error)) { qDebug()<<"Unable to load the plugin :"<<error; delete componentData->engine; return 0; } - componentData->component = new QDeclarativeComponent(componentData->engine); + componentData->component = new QQmlComponent(componentData->engine); componentData->component->setData(qmlProgram.toUtf8(), QUrl()); componentData->qmlElement = componentData->component->create(); if (componentData->component->isError()) @@ -149,14 +149,14 @@ ComponentData *TestJsonDbChangesSinceObject::createComponent() ComponentData *TestJsonDbChangesSinceObject::createPartitionComponent() { ComponentData *componentData = new ComponentData(); - componentData->engine = new QDeclarativeEngine(); + componentData->engine = new QQmlEngine(); QString error; if (!componentData->engine->importPlugin(mPluginPath, QString("QtJsonDb"), &error)) { qDebug()<<"Unable to load the plugin :"<<error; delete componentData->engine; return 0; } - componentData->component = new QDeclarativeComponent(componentData->engine); + componentData->component = new QQmlComponent(componentData->engine); componentData->component->setData(qmlProgramForPartition.toUtf8(), QUrl()); componentData->qmlElement = componentData->component->create(); if (componentData->component->isError()) @@ -222,8 +222,8 @@ void TestJsonDbChangesSinceObject::singleType() int id = mClient->create(item, "com.nokia.shared"); waitForResponse1(id); const QString expression("start();"); - QDeclarativeExpression *expr; - expr = new QDeclarativeExpression(changesSinceObject->engine->rootContext(), changesSinceObject->qmlElement, expression); + QQmlExpression *expr; + expr = new QQmlExpression(changesSinceObject->engine->rootContext(), changesSinceObject->qmlElement, expression); expr->evaluate(); waitForCallback2(); QCOMPARE(cbData.size(), 1); @@ -247,8 +247,8 @@ void TestJsonDbChangesSinceObject::multipleObjects() waitForResponse1(id); qSort(items.begin(), items.end(), posLessThan); const QString expression("start();"); - QDeclarativeExpression *expr; - expr = new QDeclarativeExpression(changesSinceObject->engine->rootContext(), changesSinceObject->qmlElement, expression); + QQmlExpression *expr; + expr = new QQmlExpression(changesSinceObject->engine->rootContext(), changesSinceObject->qmlElement, expression); expr->evaluate(); waitForCallback2(); QCOMPARE(callbackError, false); @@ -288,8 +288,8 @@ void TestJsonDbChangesSinceObject::multipleTypes() id = mClient->create(item, "com.nokia.shared"); waitForResponse1(id); const QString expression("start();"); - QDeclarativeExpression *expr; - expr = new QDeclarativeExpression(changesSinceObject->engine->rootContext(), changesSinceObject->qmlElement, expression); + QQmlExpression *expr; + expr = new QQmlExpression(changesSinceObject->engine->rootContext(), changesSinceObject->qmlElement, expression); expr->evaluate(); waitForCallback2(); QCOMPARE(cbData.size(), 2); @@ -306,8 +306,8 @@ void TestJsonDbChangesSinceObject::createChangesSince() QString expression; expression = QString(createString).arg(__FUNCTION__); - QDeclarativeExpression *expr; - expr = new QDeclarativeExpression(partition->engine->rootContext(), partition->qmlElement, expression); + QQmlExpression *expr; + expr = new QQmlExpression(partition->engine->rootContext(), partition->qmlElement, expression); QPointer<QObject> queryObject = expr->evaluate().value<QObject*>(); QVERIFY(!queryObject.isNull()); queryObject->setParent(partition->qmlElement); diff --git a/tests/auto/jsondblistmodel/jsondblistmodel.pro b/tests/auto/jsondblistmodel/jsondblistmodel.pro index 67765a5..7aafd6a 100644 --- a/tests/auto/jsondblistmodel/jsondblistmodel.pro +++ b/tests/auto/jsondblistmodel/jsondblistmodel.pro @@ -3,7 +3,7 @@ TARGET = tst_jsondblistmodel DEPENDPATH += . INCLUDEPATH += . -QT = core network testlib gui declarative jsondbcompat-private +QT = core network testlib gui qml jsondbcompat-private CONFIG -= app_bundle CONFIG += testcase diff --git a/tests/auto/jsondblistmodel/testjsondblistmodel.cpp b/tests/auto/jsondblistmodel/testjsondblistmodel.cpp index 0f7bd15..88db320 100644 --- a/tests/auto/jsondblistmodel/testjsondblistmodel.cpp +++ b/tests/auto/jsondblistmodel/testjsondblistmodel.cpp @@ -164,7 +164,7 @@ void TestJsonDbListModel::initTestCase() QAbstractItemModel *TestJsonDbListModel::createModel() { ModelData *newModel = new ModelData(); - newModel->engine = new QDeclarativeEngine(); + newModel->engine = new QQmlEngine(); QString error; Q_ASSERT(!mPluginPath.isEmpty()); if (!newModel->engine->importPlugin(mPluginPath, QString("QtJsonDb"), &error)) { @@ -172,7 +172,7 @@ QAbstractItemModel *TestJsonDbListModel::createModel() 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.JsonDbListModel {id: contactsModel; partition: JsonDb.Partition {name: \"com.example.shared.1\"}}", QUrl()); newModel->model = newModel->component->create(); if (newModel->component->isError()) diff --git a/tests/auto/jsondblistmodel/testjsondblistmodel.h b/tests/auto/jsondblistmodel/testjsondblistmodel.h index 66feeb9..79b8b85 100644 --- a/tests/auto/jsondblistmodel/testjsondblistmodel.h +++ b/tests/auto/jsondblistmodel/testjsondblistmodel.h @@ -59,8 +59,8 @@ #include "../../shared/qmltestutil.h" QT_BEGIN_NAMESPACE -class QDeclarativeEngine; -class QDeclarativeComponent; +class QQmlEngine; +class QQmlComponent; QT_END_NAMESPACE QT_USE_NAMESPACE_JSONDB @@ -71,8 +71,8 @@ class ModelData { public: ModelData(); ~ModelData(); - QDeclarativeEngine *engine; - QDeclarativeComponent *component; + QQmlEngine *engine; + QQmlComponent *component; QObject *model; }; diff --git a/tests/auto/jsondbnotification/jsondbnotification.pro b/tests/auto/jsondbnotification/jsondbnotification.pro index c418b55..f4e1fd6 100644 --- a/tests/auto/jsondbnotification/jsondbnotification.pro +++ b/tests/auto/jsondbnotification/jsondbnotification.pro @@ -3,7 +3,7 @@ TARGET = tst_jsondbnotification DEPENDPATH += . INCLUDEPATH += . -QT = core network testlib gui declarative jsondbcompat-private +QT = core network testlib gui qml jsondbcompat-private CONFIG -= app_bundle CONFIG += testcase diff --git a/tests/auto/jsondbnotification/testjsondbnotification.cpp b/tests/auto/jsondbnotification/testjsondbnotification.cpp index edc8350..cb50344 100644 --- a/tests/auto/jsondbnotification/testjsondbnotification.cpp +++ b/tests/auto/jsondbnotification/testjsondbnotification.cpp @@ -132,14 +132,14 @@ void TestJsonDbNotification::initTestCase() ComponentData *TestJsonDbNotification::createComponent() { ComponentData *componentData = new ComponentData(); - componentData->engine = new QDeclarativeEngine(); + componentData->engine = new QQmlEngine(); QString error; if (!componentData->engine->importPlugin(mPluginPath, QString("QtJsonDb"), &error)) { qDebug()<<"Unable to load the plugin :"<<error; delete componentData->engine; return 0; } - componentData->component = new QDeclarativeComponent(componentData->engine); + componentData->component = new QQmlComponent(componentData->engine); componentData->component->setData(qmlProgram.toLocal8Bit(), QUrl()); componentData->qmlElement = componentData->component->create(); if (componentData->component->isError()) @@ -153,14 +153,14 @@ ComponentData *TestJsonDbNotification::createComponent() ComponentData *TestJsonDbNotification::createPartitionComponent() { ComponentData *componentData = new ComponentData(); - componentData->engine = new QDeclarativeEngine(); + componentData->engine = new QQmlEngine(); QString error; if (!componentData->engine->importPlugin(mPluginPath, QString("QtJsonDb"), &error)) { qDebug()<<"Unable to load the plugin :"<<error; delete componentData->engine; return 0; } - componentData->component = new QDeclarativeComponent(componentData->engine); + componentData->component = new QQmlComponent(componentData->engine); componentData->component->setData(qmlProgramForPartition.toLocal8Bit(), QUrl()); componentData->qmlElement = componentData->component->create(); if (componentData->component->isError()) @@ -336,8 +336,8 @@ void TestJsonDbNotification::createNotification() QString expression; expression = QString(createString).arg(__FUNCTION__); - QDeclarativeExpression *expr; - expr = new QDeclarativeExpression(partition->engine->rootContext(), partition->qmlElement, expression); + QQmlExpression *expr; + expr = new QQmlExpression(partition->engine->rootContext(), partition->qmlElement, expression); QPointer<QObject> notification = expr->evaluate().value<QObject*>(); QVERIFY(!notification.isNull()); notification->setParent(partition->qmlElement); diff --git a/tests/auto/jsondbpartition/jsondbpartition.pro b/tests/auto/jsondbpartition/jsondbpartition.pro index e067d7b..09433e1 100644 --- a/tests/auto/jsondbpartition/jsondbpartition.pro +++ b/tests/auto/jsondbpartition/jsondbpartition.pro @@ -3,7 +3,7 @@ TARGET = tst_jsondbpartition DEPENDPATH += . INCLUDEPATH += . -QT = core network testlib gui declarative jsondbcompat-private +QT = core network testlib gui qml jsondbcompat-private CONFIG -= app_bundle CONFIG += testcase diff --git a/tests/auto/jsondbpartition/testjsondbpartition.cpp b/tests/auto/jsondbpartition/testjsondbpartition.cpp index ec482e0..98e3b7e 100644 --- a/tests/auto/jsondbpartition/testjsondbpartition.cpp +++ b/tests/auto/jsondbpartition/testjsondbpartition.cpp @@ -131,14 +131,14 @@ void TestJsonDbPartition::initTestCase() ComponentData *TestJsonDbPartition::createComponent() { ComponentData *componentData = new ComponentData(); - componentData->engine = new QDeclarativeEngine(); + componentData->engine = new QQmlEngine(); QString error; if (!componentData->engine->importPlugin(mPluginPath, QString("QtJsonDb"), &error)) { qDebug()<<"Unable to load the plugin :"<<error; delete componentData->engine; return 0; } - componentData->component = new QDeclarativeComponent(componentData->engine); + componentData->component = new QQmlComponent(componentData->engine); componentData->component->setData(qmlProgram.toLocal8Bit(), QUrl()); componentData->qmlElement = componentData->component->create(); if (componentData->component->isError()) @@ -188,9 +188,9 @@ void TestJsonDbPartition::create() obj = createObject(__FUNCTION__); expression = QString(createString).arg(objectString(QString(), obj)); - QDeclarativeExpression *expr; + QQmlExpression *expr; int id = 0; - expr = new QDeclarativeExpression(partition->engine->rootContext(), partition->qmlElement, expression); + expr = new QQmlExpression(partition->engine->rootContext(), partition->qmlElement, expression); id = expr->evaluate().toInt(); waitForCallback(); QCOMPARE(callbackError, false); @@ -234,9 +234,9 @@ void TestJsonDbPartition::update() obj = createObject(__FUNCTION__); expression = QString(createString).arg(objectString(QString(), obj)); - QDeclarativeExpression *expr; + QQmlExpression *expr; int id = 0; - expr = new QDeclarativeExpression(partition->engine->rootContext(), partition->qmlElement, expression); + expr = new QQmlExpression(partition->engine->rootContext(), partition->qmlElement, expression); id = expr->evaluate().toInt(); waitForCallback(); QCOMPARE(callbackError, false); @@ -299,9 +299,9 @@ void TestJsonDbPartition::remove() obj = createObject(__FUNCTION__); expression = QString(createString).arg(objectString(QString(), obj)); - QDeclarativeExpression *expr; + QQmlExpression *expr; int id = 0; - expr = new QDeclarativeExpression(partition->engine->rootContext(), partition->qmlElement, expression); + expr = new QQmlExpression(partition->engine->rootContext(), partition->qmlElement, expression); id = expr->evaluate().toInt(); waitForCallback(); QCOMPARE(callbackError, false); @@ -355,9 +355,9 @@ void TestJsonDbPartition::find() obj = createObject(__FUNCTION__); expression = QString(createString).arg(objectString(QString(), obj)); - QDeclarativeExpression *expr; + QQmlExpression *expr; int id = 0; - expr = new QDeclarativeExpression(partition->engine->rootContext(), partition->qmlElement, expression); + expr = new QQmlExpression(partition->engine->rootContext(), partition->qmlElement, expression); id = expr->evaluate().toInt(); waitForCallback(); QCOMPARE(callbackError, false); diff --git a/tests/auto/jsondbqueryobject/jsondbqueryobject.pro b/tests/auto/jsondbqueryobject/jsondbqueryobject.pro index 365b963..62157bb 100644 --- a/tests/auto/jsondbqueryobject/jsondbqueryobject.pro +++ b/tests/auto/jsondbqueryobject/jsondbqueryobject.pro @@ -3,7 +3,7 @@ TARGET = tst_jsondbqueryobject DEPENDPATH += . INCLUDEPATH += . -QT = core network testlib gui declarative jsondbcompat-private +QT = core network testlib gui qml jsondbcompat-private CONFIG -= app_bundle CONFIG += testcase diff --git a/tests/auto/jsondbqueryobject/testjsondbqueryobject.cpp b/tests/auto/jsondbqueryobject/testjsondbqueryobject.cpp index 74954c4..300caa5 100644 --- a/tests/auto/jsondbqueryobject/testjsondbqueryobject.cpp +++ b/tests/auto/jsondbqueryobject/testjsondbqueryobject.cpp @@ -128,14 +128,14 @@ void TestJsonDbQueryObject::initTestCase() ComponentData *TestJsonDbQueryObject::createComponent() { ComponentData *componentData = new ComponentData(); - componentData->engine = new QDeclarativeEngine(); + componentData->engine = new QQmlEngine(); QString error; if (!componentData->engine->importPlugin(mPluginPath, QString("QtJsonDb"), &error)) { qDebug()<<"Unable to load the plugin :"<<error; delete componentData->engine; return 0; } - componentData->component = new QDeclarativeComponent(componentData->engine); + componentData->component = new QQmlComponent(componentData->engine); componentData->component->setData(qmlProgram.toLocal8Bit(), QUrl()); componentData->qmlElement = componentData->component->create(); if (componentData->component->isError()) @@ -151,14 +151,14 @@ ComponentData *TestJsonDbQueryObject::createComponent() ComponentData *TestJsonDbQueryObject::createPartitionComponent() { ComponentData *componentData = new ComponentData(); - componentData->engine = new QDeclarativeEngine(); + componentData->engine = new QQmlEngine(); QString error; if (!componentData->engine->importPlugin(mPluginPath, QString("QtJsonDb"), &error)) { qDebug()<<"Unable to load the plugin :"<<error; delete componentData->engine; return 0; } - componentData->component = new QDeclarativeComponent(componentData->engine); + componentData->component = new QQmlComponent(componentData->engine); componentData->component->setData(qmlProgramForPartition.toLocal8Bit(), QUrl()); componentData->qmlElement = componentData->component->create(); if (componentData->component->isError()) @@ -223,8 +223,8 @@ void TestJsonDbQueryObject::singleObject() QVariantMap item = createObject(__FUNCTION__).toMap(); mClient->create(item, "com.nokia.shared"); const QString expression("start();"); - QDeclarativeExpression *expr; - expr = new QDeclarativeExpression(queryObject->engine->rootContext(), queryObject->qmlElement, expression); + QQmlExpression *expr; + expr = new QQmlExpression(queryObject->engine->rootContext(), queryObject->qmlElement, expression); expr->evaluate(); waitForCallback2(); QCOMPARE(cbData.size(), 1); @@ -254,8 +254,8 @@ void TestJsonDbQueryObject::multipleObjects() mClient->create(QVariant(items), "com.nokia.shared"); qSort(items.begin(), items.end(), posLessThan); const QString expression("start();"); - QDeclarativeExpression *expr; - expr = new QDeclarativeExpression(queryObject->engine->rootContext(), queryObject->qmlElement, expression); + QQmlExpression *expr; + expr = new QQmlExpression(queryObject->engine->rootContext(), queryObject->qmlElement, expression); expr->evaluate(); waitForCallback2(); QCOMPARE(callbackError, false); @@ -278,8 +278,8 @@ void TestJsonDbQueryObject::createQuery() QString expression; expression = QString(createString).arg(__FUNCTION__); - QDeclarativeExpression *expr; - expr = new QDeclarativeExpression(partition->engine->rootContext(), partition->qmlElement, expression); + QQmlExpression *expr; + expr = new QQmlExpression(partition->engine->rootContext(), partition->qmlElement, expression); QPointer<QObject> queryObject = expr->evaluate().value<QObject*>(); QVERIFY(!queryObject.isNull()); queryObject->setParent(partition->qmlElement); @@ -318,8 +318,8 @@ void TestJsonDbQueryObject::queryBinding() mClient->create(QVariant(items), "com.nokia.shared"); qSort(items.begin(), items.end(), posLessThan); const QString expression("start();"); - QDeclarativeExpression *expr; - expr = new QDeclarativeExpression(queryObject->engine->rootContext(), queryObject->qmlElement, expression); + QQmlExpression *expr; + expr = new QQmlExpression(queryObject->engine->rootContext(), queryObject->qmlElement, expression); expr->evaluate(); waitForCallback2(); @@ -351,8 +351,8 @@ void TestJsonDbQueryObject::queryError() mClient->create(QVariant(items), "com.nokia.shared"); qSort(items.begin(), items.end(), posLessThan); const QString expression("start();"); - QDeclarativeExpression *expr; - expr = new QDeclarativeExpression(queryObject->engine->rootContext(), queryObject->qmlElement, expression); + QQmlExpression *expr; + expr = new QQmlExpression(queryObject->engine->rootContext(), queryObject->qmlElement, expression); expr->evaluate(); waitForCallback2(); @@ -383,8 +383,8 @@ void TestJsonDbQueryObject::queryLimit() mClient->create(QVariant(items), "com.nokia.shared"); qSort(items.begin(), items.end(), posLessThan); const QString expression("start();"); - QDeclarativeExpression *expr; - expr = new QDeclarativeExpression(queryObject->engine->rootContext(), queryObject->qmlElement, expression); + QQmlExpression *expr; + expr = new QQmlExpression(queryObject->engine->rootContext(), queryObject->qmlElement, expression); expr->evaluate(); waitForCallback2(); QCOMPARE(callbackError, false); diff --git a/tests/auto/jsondbsortinglistmodel/jsondbsortinglistmodel.pro b/tests/auto/jsondbsortinglistmodel/jsondbsortinglistmodel.pro index 513d35b..cea282e 100644 --- a/tests/auto/jsondbsortinglistmodel/jsondbsortinglistmodel.pro +++ b/tests/auto/jsondbsortinglistmodel/jsondbsortinglistmodel.pro @@ -3,7 +3,7 @@ TARGET = tst_jsondbsortinglistmodel DEPENDPATH += . INCLUDEPATH += . -QT = core network testlib gui declarative jsondbcompat-private +QT = core network testlib gui qml jsondbcompat-private CONFIG -= app_bundle CONFIG += testcase diff --git a/tests/auto/jsondbsortinglistmodel/testjsondbsortinglistmodel.cpp b/tests/auto/jsondbsortinglistmodel/testjsondbsortinglistmodel.cpp index 4ba9c6e..3fe7182 100644 --- a/tests/auto/jsondbsortinglistmodel/testjsondbsortinglistmodel.cpp +++ b/tests/auto/jsondbsortinglistmodel/testjsondbsortinglistmodel.cpp @@ -44,7 +44,7 @@ #include "testjsondbsortinglistmodel.h" #include "../../shared/util.h" -#include <QDeclarativeListReference> +#include <QQmlListReference> #include "json.h" static const char dbfile[] = "dbFile-jsondb-listmodel"; @@ -186,14 +186,14 @@ void TestJsonDbSortingListModel::initTestCase() QAbstractListModel *TestJsonDbSortingListModel::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.JsonDbSortingListModel {id: contactsModel}", QUrl()); @@ -201,7 +201,7 @@ QAbstractListModel *TestJsonDbSortingListModel::createModel() if (newModel->component->isError()) qDebug() << newModel->component->errors(); - 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()); @@ -210,7 +210,7 @@ QAbstractListModel *TestJsonDbSortingListModel::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()); @@ -218,7 +218,7 @@ QAbstractListModel *TestJsonDbSortingListModel::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->parttion1); partitions.append(newModel->parttion2); diff --git a/tests/auto/jsondbsortinglistmodel/testjsondbsortinglistmodel.h b/tests/auto/jsondbsortinglistmodel/testjsondbsortinglistmodel.h index 9910a61..752eb9a 100644 --- a/tests/auto/jsondbsortinglistmodel/testjsondbsortinglistmodel.h +++ b/tests/auto/jsondbsortinglistmodel/testjsondbsortinglistmodel.h @@ -59,8 +59,8 @@ #include "../../shared/qmltestutil.h" QT_BEGIN_NAMESPACE -class QDeclarativeEngine; -class QDeclarativeComponent; +class QQmlEngine; +class QQmlComponent; QT_END_NAMESPACE QT_USE_NAMESPACE_JSONDB @@ -71,10 +71,10 @@ class ModelData { public: ModelData(); ~ModelData(); - QDeclarativeEngine *engine; - QDeclarativeComponent *component; - QDeclarativeComponent *partitionComponent1; - QDeclarativeComponent *partitionComponent2; + QQmlEngine *engine; + QQmlComponent *component; + QQmlComponent *partitionComponent1; + QQmlComponent *partitionComponent2; QObject *model; QObject *parttion1; QObject *parttion2; diff --git a/tests/auto/jsonstream/jsonstream.pro b/tests/auto/jsonstream/jsonstream.pro index 1b12215..172fc7b 100644 --- a/tests/auto/jsonstream/jsonstream.pro +++ b/tests/auto/jsonstream/jsonstream.pro @@ -1,6 +1,6 @@ TARGET = tst_jsonstream -QT = declarative network testlib +QT = qml network testlib CONFIG -= app_bundle CONFIG += testcase diff --git a/tests/auto/queries/queries.pro b/tests/auto/queries/queries.pro index daf0c53..620406b 100644 --- a/tests/auto/queries/queries.pro +++ b/tests/auto/queries/queries.pro @@ -1,6 +1,6 @@ TARGET = tst_queries -QT = network declarative testlib +QT = network qml testlib CONFIG -= app_bundle CONFIG += testcase diff --git a/tests/benchmarks/daemon/daemon.pro b/tests/benchmarks/daemon/daemon.pro index b296978..a76caaf 100644 --- a/tests/benchmarks/daemon/daemon.pro +++ b/tests/benchmarks/daemon/daemon.pro @@ -1,6 +1,6 @@ TARGET = tst_bench_daemon -QT = network declarative testlib +QT = network qml testlib CONFIG -= app_bundle CONFIG += testcase diff --git a/tests/benchmarks/jsondb-listmodel/jsondb-listmodel.pro b/tests/benchmarks/jsondb-listmodel/jsondb-listmodel.pro index 27aa6e3..3a8098f 100644 --- a/tests/benchmarks/jsondb-listmodel/jsondb-listmodel.pro +++ b/tests/benchmarks/jsondb-listmodel/jsondb-listmodel.pro @@ -1,7 +1,7 @@ TEMPLATE = app TARGET = tst_bench_listmodel -QT = core network testlib gui declarative jsondbcompat-private +QT = core network testlib gui qml jsondbcompat-private CONFIG -= app_bundle include($$PWD/../../shared/shared.pri) diff --git a/tests/benchmarks/jsondb-listmodel/listmodel-benchmark.cpp b/tests/benchmarks/jsondb-listmodel/listmodel-benchmark.cpp index 27e42a9..1c6fa78 100644 --- a/tests/benchmarks/jsondb-listmodel/listmodel-benchmark.cpp +++ b/tests/benchmarks/jsondb-listmodel/listmodel-benchmark.cpp @@ -44,9 +44,9 @@ #include "listmodel-benchmark.h" #include "../../shared/util.h" -#include <QDeclarativeEngine> -#include <QDeclarativeComponent> -#include <QDeclarativeContext> +#include <QQmlEngine> +#include <QQmlComponent> +#include <QQmlContext> static const char dbfile[] = "dbFile-test-jsondb"; ModelData::ModelData(): engine(0), component(0), model(0) @@ -108,7 +108,7 @@ void TestListModel::initTestCase() QVERIFY(mClient!= 0); connectToServer(); - QDeclarativeEngine *engine = new QDeclarativeEngine(); + QQmlEngine *engine = new QQmlEngine(); QStringList pluginPaths = engine->importPathList(); for (int i=0; (i<pluginPaths.count() && mPluginPath.isEmpty()); i++) { QDir dir(pluginPaths[i]+"/QtAddOn/JsonDb"); @@ -170,14 +170,14 @@ void TestListModel::initTestCase() JsonDbListModel *TestListModel::createModel() { ModelData *newModel = new ModelData(); - newModel->engine = new QDeclarativeEngine(); + newModel->engine = new QQmlEngine(); QString error; if (!newModel->engine->importPlugin(mPluginPath, QString("QtAddOn.JsonDb"), &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 QtAddOn.JsonDb 1.0 \n JsonDbListModel {id: contactsModel}", QUrl()); newModel->model = newModel->component->create(); mModels.append(newModel); diff --git a/tests/benchmarks/jsondb-listmodel/listmodel-benchmark.h b/tests/benchmarks/jsondb-listmodel/listmodel-benchmark.h index d305eca..b0a0d9f 100644 --- a/tests/benchmarks/jsondb-listmodel/listmodel-benchmark.h +++ b/tests/benchmarks/jsondb-listmodel/listmodel-benchmark.h @@ -57,8 +57,8 @@ #include "jsondb-listmodel.h" QT_BEGIN_NAMESPACE -class QDeclarativeEngine; -class QDeclarativeComponent; +class QQmlEngine; +class QQmlComponent; QT_END_NAMESPACE QT_USE_NAMESPACE_JSONDB @@ -68,8 +68,8 @@ class ModelData { public: ModelData(); ~ModelData(); - QDeclarativeEngine *engine; - QDeclarativeComponent *component; + QQmlEngine *engine; + QQmlComponent *component; QObject *model; }; 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) diff --git a/tests/benchmarks/jsondbcachinglistmodel/jsondbcachinglistmodel-bench.h b/tests/benchmarks/jsondbcachinglistmodel/jsondbcachinglistmodel-bench.h index 1dc866c..cfac030 100644 --- a/tests/benchmarks/jsondbcachinglistmodel/jsondbcachinglistmodel-bench.h +++ b/tests/benchmarks/jsondbcachinglistmodel/jsondbcachinglistmodel-bench.h @@ -59,8 +59,8 @@ #include "../../shared/qmltestutil.h" QT_BEGIN_NAMESPACE -class QDeclarativeEngine; -class QDeclarativeComponent; +class QQmlEngine; +class QQmlComponent; QT_END_NAMESPACE QT_USE_NAMESPACE_JSONDB @@ -71,10 +71,10 @@ class ModelData { public: ModelData(); ~ModelData(); - QDeclarativeEngine *engine; - QDeclarativeComponent *component; - QDeclarativeComponent *partitionComponent1; - QDeclarativeComponent *partitionComponent2; + QQmlEngine *engine; + QQmlComponent *component; + QQmlComponent *partitionComponent1; + QQmlComponent *partitionComponent2; QObject *model; QObject *partition1; QObject *partition2; diff --git a/tests/benchmarks/jsondbcachinglistmodel/jsondbcachinglistmodel.pro b/tests/benchmarks/jsondbcachinglistmodel/jsondbcachinglistmodel.pro index 114f94b..1c0d1ae 100644 --- a/tests/benchmarks/jsondbcachinglistmodel/jsondbcachinglistmodel.pro +++ b/tests/benchmarks/jsondbcachinglistmodel/jsondbcachinglistmodel.pro @@ -3,7 +3,7 @@ TARGET = tst_bench_jsondbcachinglistmodel DEPENDPATH += . INCLUDEPATH += . -QT = core network testlib gui declarative jsondbcompat-private +QT = core network testlib gui qml jsondbcompat-private CONFIG -= app_bundle CONFIG += testcase diff --git a/tests/benchmarks/jsondbsortinglistmodel/jsondbsortinglistmodel-bench.cpp b/tests/benchmarks/jsondbsortinglistmodel/jsondbsortinglistmodel-bench.cpp index 9e1ba50..7c91ca4 100644 --- a/tests/benchmarks/jsondbsortinglistmodel/jsondbsortinglistmodel-bench.cpp +++ b/tests/benchmarks/jsondbsortinglistmodel/jsondbsortinglistmodel-bench.cpp @@ -44,7 +44,7 @@ #include "jsondbsortinglistmodel-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 JsonDbSortingListModelBench::initTestCase() QAbstractListModel *JsonDbSortingListModelBench::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;}", QUrl()); @@ -177,7 +177,7 @@ QAbstractListModel *JsonDbSortingListModelBench::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 *JsonDbSortingListModelBench::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 *JsonDbSortingListModelBench::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 JsonDbSortingListModelBench::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) diff --git a/tests/benchmarks/jsondbsortinglistmodel/jsondbsortinglistmodel-bench.h b/tests/benchmarks/jsondbsortinglistmodel/jsondbsortinglistmodel-bench.h index 618756e..68ae04f 100644 --- a/tests/benchmarks/jsondbsortinglistmodel/jsondbsortinglistmodel-bench.h +++ b/tests/benchmarks/jsondbsortinglistmodel/jsondbsortinglistmodel-bench.h @@ -59,8 +59,8 @@ #include "../../shared/qmltestutil.h" QT_BEGIN_NAMESPACE -class QDeclarativeEngine; -class QDeclarativeComponent; +class QQmlEngine; +class QQmlComponent; QT_END_NAMESPACE QT_USE_NAMESPACE_JSONDB @@ -71,10 +71,10 @@ class ModelData { public: ModelData(); ~ModelData(); - QDeclarativeEngine *engine; - QDeclarativeComponent *component; - QDeclarativeComponent *partitionComponent1; - QDeclarativeComponent *partitionComponent2; + QQmlEngine *engine; + QQmlComponent *component; + QQmlComponent *partitionComponent1; + QQmlComponent *partitionComponent2; QObject *model; QObject *partition1; QObject *partition2; diff --git a/tests/benchmarks/jsondbsortinglistmodel/jsondbsortinglistmodel.pro b/tests/benchmarks/jsondbsortinglistmodel/jsondbsortinglistmodel.pro index 29aeeec..f1fe37e 100644 --- a/tests/benchmarks/jsondbsortinglistmodel/jsondbsortinglistmodel.pro +++ b/tests/benchmarks/jsondbsortinglistmodel/jsondbsortinglistmodel.pro @@ -3,7 +3,7 @@ TARGET = tst_bench_jsondbsortinglistmodel DEPENDPATH += . INCLUDEPATH += . -QT = core network testlib gui declarative jsondbcompat-private +QT = core network testlib gui qml jsondbcompat-private CONFIG -= app_bundle CONFIG += testcase diff --git a/tests/shared/qmltestutil.h b/tests/shared/qmltestutil.h index c7bd58d..9d9d4d0 100644 --- a/tests/shared/qmltestutil.h +++ b/tests/shared/qmltestutil.h @@ -42,12 +42,12 @@ #ifndef QMLTESTUTIL_H #define QMLTESTUTIL_H -#include <QDeclarativeEngine> -#include <QDeclarativeComponent> -#include <QDeclarativeContext> -#include <QDeclarativeExpression> -#include <QDeclarativeError> -#include <QDeclarativeProperty> +#include <QQmlEngine> +#include <QQmlComponent> +#include <QQmlContext> +#include <QQmlExpression> +#include <QQmlError> +#include <QQmlProperty> #include <QDir> #define waitForCallbackGeneric(eventloop) \ @@ -166,7 +166,7 @@ inline QString findQMLPluginPath(const QString &pluginName) { QString pluginPath; qsrand(QTime::currentTime().msec()); - QDeclarativeEngine *engine = new QDeclarativeEngine(); + QQmlEngine *engine = new QQmlEngine(); QStringList pluginPaths = engine->importPathList(); for (int i=0; (i<pluginPaths.count() && pluginPath.isEmpty()); i++) { QDir dir(pluginPaths[i]+"/"+pluginName); @@ -193,8 +193,8 @@ public: delete component; delete engine; } - QDeclarativeEngine *engine; - QDeclarativeComponent *component; + QQmlEngine *engine; + QQmlComponent *component; QObject *qmlElement; }; diff --git a/tools/jsondb-client/client.cpp b/tools/jsondb-client/client.cpp index 08135fc..b345934 100644 --- a/tools/jsondb-client/client.cpp +++ b/tools/jsondb-client/client.cpp @@ -48,8 +48,8 @@ #include <sstream> #include <iomanip> -#include <QDeclarativeComponent> -#include <QDeclarativeEngine> +#include <QQmlComponent> +#include <QQmlEngine> QT_USE_NAMESPACE @@ -669,12 +669,12 @@ void Client::loadQmlFile(const QString &qmlFile) } if (!mEngine) { - mEngine = new QDeclarativeEngine(this); + mEngine = new QQmlEngine(this); connect(mEngine, SIGNAL(quit()), this, SLOT(fileLoadSuccess())); } qml.open(QFile::ReadOnly); - QDeclarativeComponent *component = new QDeclarativeComponent(mEngine, this); + QQmlComponent *component = new QQmlComponent(mEngine, this); component->setData(qml.readAll(), QUrl()); qml.close(); diff --git a/tools/jsondb-client/client.h b/tools/jsondb-client/client.h index 24e48b6..f12cfa8 100644 --- a/tools/jsondb-client/client.h +++ b/tools/jsondb-client/client.h @@ -48,7 +48,7 @@ #include <histedit.h> QT_BEGIN_NAMESPACE -class QDeclarativeEngine; +class QQmlEngine; QT_END_NAMESPACE class InputThread : public QThread { @@ -128,7 +128,7 @@ private: bool mTerminate; bool mDebug; QStringList mFilesToLoad; - QDeclarativeEngine *mEngine; + QQmlEngine *mEngine; }; diff --git a/tools/jsondb-client/jsondb-client.pro b/tools/jsondb-client/jsondb-client.pro index e529a98..2b6e6cb 100644 --- a/tools/jsondb-client/jsondb-client.pro +++ b/tools/jsondb-client/jsondb-client.pro @@ -4,7 +4,7 @@ DESTDIR = $$QT.jsondb.bins target.path = $$[QT_INSTALL_PREFIX]/bin INSTALLS += target -QT = core jsondb declarative gui +QT = core jsondb qml gui LIBS += -ledit diff --git a/tools/jsondb-client/main.cpp b/tools/jsondb-client/main.cpp index aa575ab..1a1867f 100644 --- a/tools/jsondb-client/main.cpp +++ b/tools/jsondb-client/main.cpp @@ -62,7 +62,7 @@ static void usage(const QString &name, int exitCode = 0) int main(int argc, char * argv[]) { // Hack to avoid making people specify a platform plugin. - // We only need QGuiApplication so that we can use QDeclarativeEngine. + // We only need QGuiApplication so that we can use QQmlEngine. bool platformSpecified = false; for (int i = 0; i < argc; i++) { if (strcmp(argv[i], "-platform") == 0) |