aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/folderlistmodel/folderlistmodel.pro8
-rw-r--r--src/imports/folderlistmodel/plugin.cpp12
-rw-r--r--src/imports/folderlistmodel/qquickfolderlistmodel.cpp (renamed from src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp)82
-rw-r--r--src/imports/folderlistmodel/qquickfolderlistmodel.h (renamed from src/imports/folderlistmodel/qdeclarativefolderlistmodel.h)26
-rw-r--r--src/imports/localstorage/localstorage.pro4
-rw-r--r--src/imports/localstorage/plugin.cpp46
-rw-r--r--src/imports/qimportbase.pri2
-rw-r--r--src/imports/qtquick2/plugin.cpp8
-rw-r--r--src/imports/qtquick2/qtquick2.pro4
-rw-r--r--src/imports/testlib/main.cpp28
-rw-r--r--src/imports/testlib/signalspy.h6
-rw-r--r--src/imports/testlib/testcase.h6
-rw-r--r--src/imports/testlib/testlib.pro6
-rw-r--r--src/imports/xmllistmodel/plugin.cpp14
-rw-r--r--src/imports/xmllistmodel/qqmlxmllistmodel.cpp (renamed from src/imports/xmllistmodel/qdeclarativexmllistmodel.cpp)276
-rw-r--r--src/imports/xmllistmodel/qqmlxmllistmodel_p.h (renamed from src/imports/xmllistmodel/qdeclarativexmllistmodel_p.h)52
-rw-r--r--src/imports/xmllistmodel/xmllistmodel.pro8
17 files changed, 294 insertions, 294 deletions
diff --git a/src/imports/folderlistmodel/folderlistmodel.pro b/src/imports/folderlistmodel/folderlistmodel.pro
index 26efc654b8..b4cfcea495 100644
--- a/src/imports/folderlistmodel/folderlistmodel.pro
+++ b/src/imports/folderlistmodel/folderlistmodel.pro
@@ -2,12 +2,12 @@ TARGET = qmlfolderlistmodelplugin
TARGETPATH = Qt/labs/folderlistmodel
include(../qimportbase.pri)
-QT += widgets declarative
+QT += widgets qml
-SOURCES += qdeclarativefolderlistmodel.cpp plugin.cpp
-HEADERS += qdeclarativefolderlistmodel.h
+SOURCES += qquickfolderlistmodel.cpp plugin.cpp
+HEADERS += qquickfolderlistmodel.h
-DESTDIR = $$QT.declarative.imports/$$TARGETPATH
+DESTDIR = $$QT.qml.imports/$$TARGETPATH
target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
qmldir.files += $$PWD/qmldir
diff --git a/src/imports/folderlistmodel/plugin.cpp b/src/imports/folderlistmodel/plugin.cpp
index 48d7b5b7cb..78fc230fdc 100644
--- a/src/imports/folderlistmodel/plugin.cpp
+++ b/src/imports/folderlistmodel/plugin.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/
**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
+** This file is part of the QtQml module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
@@ -39,15 +39,15 @@
**
****************************************************************************/
-#include <QtDeclarative/qdeclarativeextensionplugin.h>
-#include <QtDeclarative/qdeclarative.h>
+#include <QtQml/qqmlextensionplugin.h>
+#include <QtQml/qqml.h>
-#include "qdeclarativefolderlistmodel.h"
+#include "qquickfolderlistmodel.h"
QT_BEGIN_NAMESPACE
//![class decl]
-class QmlFolderListModelPlugin : public QDeclarativeExtensionPlugin
+class QmlFolderListModelPlugin : public QQmlExtensionPlugin
{
Q_OBJECT
public:
@@ -55,7 +55,7 @@ public:
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.folderlistmodel"));
#ifndef QT_NO_DIRMODEL
- qmlRegisterType<QDeclarativeFolderListModel>(uri,1,0,"FolderListModel");
+ qmlRegisterType<QQuickFolderListModel>(uri,1,0,"FolderListModel");
#endif
}
};
diff --git a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
index 870479afad..5621622cca 100644
--- a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
+++ b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
@@ -40,39 +40,39 @@
****************************************************************************/
//![code]
-#include "qdeclarativefolderlistmodel.h"
+#include "qquickfolderlistmodel.h"
#include <QDirModel>
#include <QDebug>
-#include <qdeclarativecontext.h>
+#include <qqmlcontext.h>
#ifndef QT_NO_DIRMODEL
QT_BEGIN_NAMESPACE
-class QDeclarativeFolderListModelPrivate
+class QQuickFolderListModelPrivate
{
public:
- QDeclarativeFolderListModelPrivate()
- : sortField(QDeclarativeFolderListModel::Name), sortReversed(false), count(0), showDirs(true), showDots(false), showOnlyReadable(false), insideRefresh(false) {
+ QQuickFolderListModelPrivate()
+ : sortField(QQuickFolderListModel::Name), sortReversed(false), count(0), showDirs(true), showDots(false), showOnlyReadable(false), insideRefresh(false) {
nameFilters << QLatin1String("*");
}
void updateSorting() {
QDir::SortFlags flags = 0;
switch(sortField) {
- case QDeclarativeFolderListModel::Unsorted:
+ case QQuickFolderListModel::Unsorted:
flags |= QDir::Unsorted;
break;
- case QDeclarativeFolderListModel::Name:
+ case QQuickFolderListModel::Name:
flags |= QDir::Name;
break;
- case QDeclarativeFolderListModel::Time:
+ case QQuickFolderListModel::Time:
flags |= QDir::Time;
break;
- case QDeclarativeFolderListModel::Size:
+ case QQuickFolderListModel::Size:
flags |= QDir::Size;
break;
- case QDeclarativeFolderListModel::Type:
+ case QQuickFolderListModel::Type:
flags |= QDir::Type;
break;
}
@@ -87,7 +87,7 @@ public:
QUrl folder;
QStringList nameFilters;
QModelIndex folderIndex;
- QDeclarativeFolderListModel::SortField sortField;
+ QQuickFolderListModel::SortField sortField;
bool sortReversed;
int count;
bool showDirs;
@@ -97,7 +97,7 @@ public:
};
/*!
- \qmlclass FolderListModel QDeclarativeFolderListModel
+ \qmlclass FolderListModel QQuickFolderListModel
\ingroup qml-working-with-data
\brief The FolderListModel provides a model of the contents of a file system folder.
@@ -144,7 +144,7 @@ public:
The following example shows a FolderListModel being used to provide a list
of QML files in a \l ListView:
- \snippet doc/src/snippets/declarative/folderlistmodel.qml 0
+ \snippet doc/src/snippets/qml/folderlistmodel.qml 0
\section1 Path Separators
@@ -156,7 +156,7 @@ public:
\sa {QML Data Models}
*/
-QDeclarativeFolderListModel::QDeclarativeFolderListModel(QObject *parent)
+QQuickFolderListModel::QQuickFolderListModel(QObject *parent)
: QAbstractListModel(parent)
{
QHash<int, QByteArray> roles;
@@ -164,7 +164,7 @@ QDeclarativeFolderListModel::QDeclarativeFolderListModel(QObject *parent)
roles[FilePathRole] = "filePath";
setRoleNames(roles);
- d = new QDeclarativeFolderListModelPrivate;
+ d = new QQuickFolderListModelPrivate;
d->model.setFilter(QDir::AllDirs | QDir::Files | QDir::Drives | QDir::NoDotAndDotDot);
connect(&d->model, SIGNAL(rowsInserted(const QModelIndex&,int,int))
, this, SLOT(inserted(const QModelIndex&,int,int)));
@@ -176,12 +176,12 @@ QDeclarativeFolderListModel::QDeclarativeFolderListModel(QObject *parent)
connect(&d->model, SIGNAL(layoutChanged()), this, SLOT(refresh()));
}
-QDeclarativeFolderListModel::~QDeclarativeFolderListModel()
+QQuickFolderListModel::~QQuickFolderListModel()
{
delete d;
}
-QVariant QDeclarativeFolderListModel::data(const QModelIndex &index, int role) const
+QVariant QQuickFolderListModel::data(const QModelIndex &index, int role) const
{
QVariant rv;
QModelIndex modelIndex = d->model.index(index.row(), 0, d->folderIndex);
@@ -200,7 +200,7 @@ QVariant QDeclarativeFolderListModel::data(const QModelIndex &index, int role) c
Returns the number of items in the current folder that match the
filter criteria.
*/
-int QDeclarativeFolderListModel::rowCount(const QModelIndex &parent) const
+int QQuickFolderListModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
return d->count;
@@ -217,12 +217,12 @@ int QDeclarativeFolderListModel::rowCount(const QModelIndex &parent) const
By default, the value is an invalid URL.
*/
-QUrl QDeclarativeFolderListModel::folder() const
+QUrl QQuickFolderListModel::folder() const
{
return d->folder;
}
-void QDeclarativeFolderListModel::setFolder(const QUrl &folder)
+void QQuickFolderListModel::setFolder(const QUrl &folder)
{
if (folder == d->folder)
return;
@@ -235,7 +235,7 @@ void QDeclarativeFolderListModel::setFolder(const QUrl &folder)
}
}
-void QDeclarativeFolderListModel::resetFiltering()
+void QQuickFolderListModel::resetFiltering()
{
// ensure that we reset the filtering rules, because the QDirModel::index()
// function isn't quite as const as it claims to be.
@@ -264,7 +264,7 @@ void QDeclarativeFolderListModel::resetFiltering()
Returns the URL of the parent of of the current \l folder.
*/
-QUrl QDeclarativeFolderListModel::parentFolder() const
+QUrl QQuickFolderListModel::parentFolder() const
{
QString localFile = d->folder.toLocalFile();
if (!localFile.isEmpty()) {
@@ -301,22 +301,22 @@ QUrl QDeclarativeFolderListModel::parentFolder() const
\note Directories are not excluded by filters.
*/
-QStringList QDeclarativeFolderListModel::nameFilters() const
+QStringList QQuickFolderListModel::nameFilters() const
{
return d->nameFilters;
}
-void QDeclarativeFolderListModel::setNameFilters(const QStringList &filters)
+void QQuickFolderListModel::setNameFilters(const QStringList &filters)
{
d->nameFilters = filters;
d->model.setNameFilters(d->nameFilters);
}
-void QDeclarativeFolderListModel::classBegin()
+void QQuickFolderListModel::classBegin()
{
}
-void QDeclarativeFolderListModel::componentComplete()
+void QQuickFolderListModel::componentComplete()
{
if (!d->folder.isValid() || d->folder.toLocalFile().isEmpty() || !QDir().exists(d->folder.toLocalFile()))
setFolder(QUrl(QLatin1String("file://")+QDir::currentPath()));
@@ -340,12 +340,12 @@ void QDeclarativeFolderListModel::componentComplete()
\sa sortReversed
*/
-QDeclarativeFolderListModel::SortField QDeclarativeFolderListModel::sortField() const
+QQuickFolderListModel::SortField QQuickFolderListModel::sortField() const
{
return d->sortField;
}
-void QDeclarativeFolderListModel::setSortField(SortField field)
+void QQuickFolderListModel::setSortField(SortField field)
{
if (field != d->sortField) {
d->sortField = field;
@@ -360,12 +360,12 @@ void QDeclarativeFolderListModel::setSortField(SortField field)
\sa sortField
*/
-bool QDeclarativeFolderListModel::sortReversed() const
+bool QQuickFolderListModel::sortReversed() const
{
return d->sortReversed;
}
-void QDeclarativeFolderListModel::setSortReversed(bool rev)
+void QQuickFolderListModel::setSortReversed(bool rev)
{
if (rev != d->sortReversed) {
d->sortReversed = rev;
@@ -379,7 +379,7 @@ void QDeclarativeFolderListModel::setSortReversed(bool rev)
Returns true if the entry \a index is a folder; otherwise
returns false.
*/
-bool QDeclarativeFolderListModel::isFolder(int index) const
+bool QQuickFolderListModel::isFolder(int index) const
{
if (index != -1) {
QModelIndex idx = d->model.index(index, 0, d->folderIndex);
@@ -389,7 +389,7 @@ bool QDeclarativeFolderListModel::isFolder(int index) const
return false;
}
-void QDeclarativeFolderListModel::refresh()
+void QQuickFolderListModel::refresh()
{
if (d->insideRefresh)
return;
@@ -413,7 +413,7 @@ void QDeclarativeFolderListModel::refresh()
d->insideRefresh = false; // finished refreshing.
}
-void QDeclarativeFolderListModel::inserted(const QModelIndex &index, int start, int end)
+void QQuickFolderListModel::inserted(const QModelIndex &index, int start, int end)
{
if (index == d->folderIndex) {
emit beginInsertRows(QModelIndex(), start, end);
@@ -422,7 +422,7 @@ void QDeclarativeFolderListModel::inserted(const QModelIndex &index, int start,
}
}
-void QDeclarativeFolderListModel::removed(const QModelIndex &index, int start, int end)
+void QQuickFolderListModel::removed(const QModelIndex &index, int start, int end)
{
if (index == d->folderIndex) {
emit beginRemoveRows(QModelIndex(), start, end);
@@ -431,7 +431,7 @@ void QDeclarativeFolderListModel::removed(const QModelIndex &index, int start, i
}
}
-void QDeclarativeFolderListModel::handleDataChanged(const QModelIndex &start, const QModelIndex &end)
+void QQuickFolderListModel::handleDataChanged(const QModelIndex &start, const QModelIndex &end)
{
if (start.parent() == d->folderIndex)
emit dataChanged(index(start.row(),0), index(end.row(),0));
@@ -449,12 +449,12 @@ void QDeclarativeFolderListModel::handleDataChanged(const QModelIndex &start, co
\sa showDotAndDotDot
*/
-bool QDeclarativeFolderListModel::showDirs() const
+bool QQuickFolderListModel::showDirs() const
{
return d->model.filter() & QDir::AllDirs;
}
-void QDeclarativeFolderListModel::setShowDirs(bool on)
+void QQuickFolderListModel::setShowDirs(bool on)
{
if (!(d->model.filter() & QDir::AllDirs) == !on)
return;
@@ -477,12 +477,12 @@ void QDeclarativeFolderListModel::setShowDirs(bool on)
\sa showDirs
*/
-bool QDeclarativeFolderListModel::showDotAndDotDot() const
+bool QQuickFolderListModel::showDotAndDotDot() const
{
return !(d->model.filter() & QDir::NoDotAndDotDot);
}
-void QDeclarativeFolderListModel::setShowDotAndDotDot(bool on)
+void QQuickFolderListModel::setShowDotAndDotDot(bool on)
{
if (!(d->model.filter() & QDir::NoDotAndDotDot) == on)
return;
@@ -505,12 +505,12 @@ void QDeclarativeFolderListModel::setShowDotAndDotDot(bool on)
\sa showDirs
*/
-bool QDeclarativeFolderListModel::showOnlyReadable() const
+bool QQuickFolderListModel::showOnlyReadable() const
{
return d->model.filter() & QDir::Readable;
}
-void QDeclarativeFolderListModel::setShowOnlyReadable(bool on)
+void QQuickFolderListModel::setShowOnlyReadable(bool on)
{
if (!(d->model.filter() & QDir::Readable) == !on)
return;
diff --git a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.h b/src/imports/folderlistmodel/qquickfolderlistmodel.h
index 5f9cb0e81a..10af7c8075 100644
--- a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.h
+++ b/src/imports/folderlistmodel/qquickfolderlistmodel.h
@@ -39,10 +39,10 @@
**
****************************************************************************/
-#ifndef QDECLARATIVEFOLDERLISTMODEL_H
-#define QDECLARATIVEFOLDERLISTMODEL_H
+#ifndef QQUICKFOLDERLISTMODEL_H
+#define QQUICKFOLDERLISTMODEL_H
-#include <qdeclarative.h>
+#include <qqml.h>
#include <QStringList>
#include <QUrl>
#include <QAbstractListModel>
@@ -54,16 +54,16 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-class QDeclarativeContext;
+class QQmlContext;
class QModelIndex;
-class QDeclarativeFolderListModelPrivate;
+class QQuickFolderListModelPrivate;
//![class begin]
-class QDeclarativeFolderListModel : public QAbstractListModel, public QDeclarativeParserStatus
+class QQuickFolderListModel : public QAbstractListModel, public QQmlParserStatus
{
Q_OBJECT
- Q_INTERFACES(QDeclarativeParserStatus)
+ Q_INTERFACES(QQmlParserStatus)
//![class begin]
//![class props]
@@ -80,8 +80,8 @@ class QDeclarativeFolderListModel : public QAbstractListModel, public QDeclarati
//![abslistmodel]
public:
- QDeclarativeFolderListModel(QObject *parent = 0);
- ~QDeclarativeFolderListModel();
+ QQuickFolderListModel(QObject *parent = 0);
+ ~QQuickFolderListModel();
enum Roles { FileNameRole = Qt::UserRole+1, FilePathRole = Qt::UserRole+2 };
@@ -141,19 +141,19 @@ private Q_SLOTS:
void handleDataChanged(const QModelIndex &start, const QModelIndex &end);
private:
- Q_DISABLE_COPY(QDeclarativeFolderListModel)
- QDeclarativeFolderListModelPrivate *d;
+ Q_DISABLE_COPY(QQuickFolderListModel)
+ QQuickFolderListModelPrivate *d;
};
//![class end]
QT_END_NAMESPACE
//![qml decl]
-QML_DECLARE_TYPE(QDeclarativeFolderListModel)
+QML_DECLARE_TYPE(QQuickFolderListModel)
//![qml decl]
QT_END_HEADER
#endif // QT_NO_DIRMODEL
-#endif // QDECLARATIVEFOLDERLISTMODEL_H
+#endif // QQUICKFOLDERLISTMODEL_H
diff --git a/src/imports/localstorage/localstorage.pro b/src/imports/localstorage/localstorage.pro
index 51a69aac4f..c54bc564d9 100644
--- a/src/imports/localstorage/localstorage.pro
+++ b/src/imports/localstorage/localstorage.pro
@@ -2,11 +2,11 @@ TARGET = qmllocalstorageplugin
TARGETPATH = QtQuick/LocalStorage
include(../qimportbase.pri)
-QT += sql declarative declarative-private v8-private core-private
+QT += sql qml qml-private v8-private core-private
SOURCES += plugin.cpp
-DESTDIR = $$QT.declarative.imports/$$TARGETPATH
+DESTDIR = $$QT.qml.imports/$$TARGETPATH
target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
qmldir.files += $$PWD/qmldir
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index dd747d0d09..77e68877d4 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -39,9 +39,9 @@
**
****************************************************************************/
#include <QStringList>
-#include <QtDeclarative/qdeclarativeextensionplugin.h>
-#include <QtDeclarative/qdeclarative.h>
-#include <private/qdeclarativeengine_p.h>
+#include <QtQml/qqmlextensionplugin.h>
+#include <QtQml/qqml.h>
+#include <private/qqmlengine_p.h>
#include <QDebug>
#include <private/qv8engine_p.h>
#include <QtSql/qsqldatabase.h>
@@ -83,18 +83,18 @@
return; \
}
-class QDeclarativeSqlDatabaseData : public QV8Engine::Deletable
+class QQmlSqlDatabaseData : public QV8Engine::Deletable
{
public:
- QDeclarativeSqlDatabaseData(QV8Engine *engine);
- ~QDeclarativeSqlDatabaseData();
+ QQmlSqlDatabaseData(QV8Engine *engine);
+ ~QQmlSqlDatabaseData();
v8::Persistent<v8::Function> constructor;
v8::Persistent<v8::Function> queryConstructor;
v8::Persistent<v8::Function> rowsConstructor;
};
-V8_DEFINE_EXTENSION(QDeclarativeSqlDatabaseData, databaseData)
+V8_DEFINE_EXTENSION(QQmlSqlDatabaseData, databaseData)
class QV8SqlDatabaseResource : public QV8ObjectResource
{
@@ -167,7 +167,7 @@ static void qmlsqldatabase_rows_setForwardOnly(v8::Local<v8::String> /* property
r->query.setForwardOnly(value->BooleanValue());
}
-QDeclarativeSqlDatabaseData::~QDeclarativeSqlDatabaseData()
+QQmlSqlDatabaseData::~QQmlSqlDatabaseData()
{
qPersistentDispose(constructor);
qPersistentDispose(queryConstructor);
@@ -239,14 +239,14 @@ static v8::Handle<v8::Value> qmlsqldatabase_executeSql(const v8::Arguments& args
QV8Engine *engine = r->engine;
if (!r->inTransaction)
- V8THROW_SQL(SQLEXCEPTION_DATABASE_ERR,QDeclarativeEngine::tr("executeSql called outside transaction()"));
+ V8THROW_SQL(SQLEXCEPTION_DATABASE_ERR,QQmlEngine::tr("executeSql called outside transaction()"));
QSqlDatabase db = r->database;
QString sql = engine->toString(args[0]);
if (r->readonly && !sql.startsWith(QLatin1String("SELECT"),Qt::CaseInsensitive)) {
- V8THROW_SQL(SQLEXCEPTION_SYNTAX_ERR, QDeclarativeEngine::tr("Read-only Transaction"));
+ V8THROW_SQL(SQLEXCEPTION_SYNTAX_ERR, QQmlEngine::tr("Read-only Transaction"));
}
QSqlQuery query(db);
@@ -316,7 +316,7 @@ static v8::Handle<v8::Value> qmlsqldatabase_changeVersion(const v8::Arguments& a
v8::Handle<v8::Value> callback = args[2];
if (from_version != r->version)
- V8THROW_SQL(SQLEXCEPTION_VERSION_ERR, QDeclarativeEngine::tr("Version mismatch: expected %1, found %2").arg(from_version).arg(r->version));
+ V8THROW_SQL(SQLEXCEPTION_VERSION_ERR, QQmlEngine::tr("Version mismatch: expected %1, found %2").arg(from_version).arg(r->version));
v8::Local<v8::Object> instance = databaseData(engine)->queryConstructor->NewInstance();
QV8SqlDatabaseResource *r2 = new QV8SqlDatabaseResource(engine);
@@ -341,7 +341,7 @@ static v8::Handle<v8::Value> qmlsqldatabase_changeVersion(const v8::Arguments& a
return v8::Handle<v8::Value>();
} else if (!db.commit()) {
db.rollback();
- V8THROW_SQL(SQLEXCEPTION_UNKNOWN_ERR,QDeclarativeEngine::tr("SQL transaction failed"));
+ V8THROW_SQL(SQLEXCEPTION_UNKNOWN_ERR,QQmlEngine::tr("SQL transaction failed"));
} else {
ok = true;
}
@@ -369,7 +369,7 @@ static v8::Handle<v8::Value> qmlsqldatabase_transaction_shared(const v8::Argumen
QV8Engine *engine = r->engine;
if (args.Length() == 0 || !args[0]->IsFunction())
- V8THROW_SQL(SQLEXCEPTION_UNKNOWN_ERR,QDeclarativeEngine::tr("transaction: missing callback"));
+ V8THROW_SQL(SQLEXCEPTION_UNKNOWN_ERR,QQmlEngine::tr("transaction: missing callback"));
QSqlDatabase db = r->database;
v8::Handle<v8::Function> callback = v8::Handle<v8::Function>::Cast(args[0]);
@@ -410,7 +410,7 @@ static v8::Handle<v8::Value> qmlsqldatabase_read_transaction(const v8::Arguments
return qmlsqldatabase_transaction_shared(args, true);
}
-QDeclarativeSqlDatabaseData::QDeclarativeSqlDatabaseData(QV8Engine *engine)
+QQmlSqlDatabaseData::QQmlSqlDatabaseData(QV8Engine *engine)
{
{
v8::Local<v8::FunctionTemplate> ft = v8::FunctionTemplate::New();
@@ -460,7 +460,7 @@ through the data.
These databases are user-specific and QML-specific, but accessible to all QML applications.
They are stored in the \c Databases subdirectory
-of QDeclarativeEngine::offlineStoragePath(), currently as SQLite databases.
+of QQmlEngine::offlineStoragePath(), currently as SQLite databases.
Database connections are automatically closed during Javascript garbage collection.
@@ -549,7 +549,7 @@ public:
~QQuickLocalStorage() {
}
- Q_INVOKABLE void openDatabaseSync(QDeclarativeV8Function* args);
+ Q_INVOKABLE void openDatabaseSync(QQmlV8Function* args);
};
/*!
@@ -563,7 +563,7 @@ public:
* \c callback is an optional parameter, which is invoked if the database has not yet been created.
* \return the database object
*/
-void QQuickLocalStorage::openDatabaseSync(QDeclarativeV8Function *args)
+void QQuickLocalStorage::openDatabaseSync(QQmlV8Function *args)
{
#ifndef QT_NO_SETTINGS
QV8Engine *engine = args->engine();
@@ -592,7 +592,7 @@ void QQuickLocalStorage::openDatabaseSync(QDeclarativeV8Function *args)
database = QSqlDatabase::database(dbid);
version = ini.value(QLatin1String("Version")).toString();
if (version != dbversion && !dbversion.isEmpty() && !version.isEmpty())
- V8THROW_SQL_VOID(SQLEXCEPTION_VERSION_ERR, QDeclarativeEngine::tr("SQL: database version mismatch"));
+ V8THROW_SQL_VOID(SQLEXCEPTION_VERSION_ERR, QQmlEngine::tr("SQL: database version mismatch"));
} else {
created = !QFile::exists(basename+QLatin1String(".sqlite"));
database = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), dbid);
@@ -607,7 +607,7 @@ void QQuickLocalStorage::openDatabaseSync(QDeclarativeV8Function *args)
} else {
if (!dbversion.isEmpty() && ini.value(QLatin1String("Version")) != dbversion) {
// Incompatible
- V8THROW_SQL_VOID(SQLEXCEPTION_VERSION_ERR,QDeclarativeEngine::tr("SQL: database version mismatch"));
+ V8THROW_SQL_VOID(SQLEXCEPTION_VERSION_ERR,QQmlEngine::tr("SQL: database version mismatch"));
}
version = ini.value(QLatin1String("Version")).toString();
}
@@ -639,7 +639,7 @@ void QQuickLocalStorage::openDatabaseSync(QDeclarativeV8Function *args)
#endif // QT_NO_SETTINGS
}
-static QObject *module_api_factory(QDeclarativeEngine *engine, QJSEngine *scriptEngine)
+static QObject *module_api_factory(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine)
Q_UNUSED(scriptEngine)
@@ -648,11 +648,11 @@ static QObject *module_api_factory(QDeclarativeEngine *engine, QJSEngine *script
return api;
}
-class QDeclarativeLocalStoragePlugin : public QDeclarativeExtensionPlugin
+class QQmlLocalStoragePlugin : public QQmlExtensionPlugin
{
Q_OBJECT
public:
- QDeclarativeLocalStoragePlugin()
+ QQmlLocalStoragePlugin()
{
}
@@ -665,4 +665,4 @@ public:
#include "plugin.moc"
-Q_EXPORT_PLUGIN2(plugin, QDeclarativeLocalStoragePlugin);
+Q_EXPORT_PLUGIN2(plugin, QQmlLocalStoragePlugin);
diff --git a/src/imports/qimportbase.pri b/src/imports/qimportbase.pri
index 110d145e94..ab54e4b1b9 100644
--- a/src/imports/qimportbase.pri
+++ b/src/imports/qimportbase.pri
@@ -14,7 +14,7 @@ isEmpty(TARGET) {
QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir
copy2build.input = QMLDIRFILE
-copy2build.output = $$QT.declarative.imports/$$TARGETPATH/qmldir
+copy2build.output = $$QT.qml.imports/$$TARGETPATH/qmldir
!contains(TEMPLATE_PREFIX, vc):copy2build.variable_out = PRE_TARGETDEPS
copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
copy2build.name = COPY ${QMAKE_FILE_IN}
diff --git a/src/imports/qtquick2/plugin.cpp b/src/imports/qtquick2/plugin.cpp
index 808d5196b2..2cb70a4fd3 100644
--- a/src/imports/qtquick2/plugin.cpp
+++ b/src/imports/qtquick2/plugin.cpp
@@ -39,23 +39,23 @@
**
****************************************************************************/
-#include <QtDeclarative/qdeclarativeextensionplugin.h>
+#include <QtQml/qqmlextensionplugin.h>
#include <private/qtquick2_p.h>
QT_BEGIN_NAMESPACE
//![class decl]
-class QtQuick2Plugin : public QDeclarativeExtensionPlugin
+class QtQuick2Plugin : public QQmlExtensionPlugin
{
Q_OBJECT
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDeclarativeExtensionInterface/1.0")
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0")
public:
virtual void registerTypes(const char *uri)
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick"));
Q_UNUSED(uri);
- QDeclarativeQtQuick2Module::defineModule();
+ QQmlQtQuick2Module::defineModule();
}
};
//![class decl]
diff --git a/src/imports/qtquick2/qtquick2.pro b/src/imports/qtquick2/qtquick2.pro
index 3f76abd87f..3a95c5fd21 100644
--- a/src/imports/qtquick2/qtquick2.pro
+++ b/src/imports/qtquick2/qtquick2.pro
@@ -5,12 +5,12 @@ include(../qimportbase.pri)
SOURCES += \
plugin.cpp
-QT += quick-private declarative-private
+QT += quick-private qml-private
OTHER_FILES += \
qmldir
-DESTDIR = $$QT.declarative.imports/$$TARGETPATH
+DESTDIR = $$QT.qml.imports/$$TARGETPATH
target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
qmldir.files += $$PWD/qmldir
diff --git a/src/imports/testlib/main.cpp b/src/imports/testlib/main.cpp
index 672de10639..8ab745a7d2 100644
--- a/src/imports/testlib/main.cpp
+++ b/src/imports/testlib/main.cpp
@@ -39,15 +39,15 @@
**
****************************************************************************/
-#include <QtDeclarative/qdeclarativeextensionplugin.h>
-#include <QtDeclarative/qdeclarative.h>
-#include <QtDeclarative/qjsvalue.h>
-#include <QtDeclarative/qjsengine.h>
+#include <QtQml/qqmlextensionplugin.h>
+#include <QtQml/qqml.h>
+#include <QtQml/qjsvalue.h>
+#include <QtQml/qjsengine.h>
#include "QtQuickTest/private/quicktestresult_p.h"
#include "QtQuickTest/private/quicktestevent_p.h"
#include "private/qtestoptions_p.h"
#include "QtQuick/qquickitem.h"
-#include <QtDeclarative/private/qdeclarativeengine_p.h>
+#include <QtQml/private/qqmlengine_p.h>
QML_DECLARE_TYPE(QuickTestResult)
QML_DECLARE_TYPE(QuickTestEvent)
@@ -81,15 +81,15 @@ Q_SIGNALS:
void wrapperChanged();
public Q_SLOTS:
- QDeclarativeV8Handle typeName(const QVariant& v) const
+ QQmlV8Handle typeName(const QVariant& v) const
{
QString name(v.typeName());
//qDebug() << "type:" << name << " string value:" << v.toString() << " value:" << v;
if (v.canConvert<QObject*>()) {
- QDeclarativeType *type = 0;
+ QQmlType *type = 0;
const QMetaObject *mo = v.value<QObject*>()->metaObject();
while (!type && mo) {
- type = QDeclarativeMetaType::qmlType(mo);
+ type = QQmlMetaType::qmlType(mo);
mo = mo->superClass();
}
if (type) {
@@ -97,22 +97,22 @@ public Q_SLOTS:
}
}
- return QDeclarativeV8Handle::fromHandle(v8::String::New(name.toUtf8()));
+ return QQmlV8Handle::fromHandle(v8::String::New(name.toUtf8()));
}
bool compare(const QVariant& act, const QVariant& exp) const {
return act == exp;
}
- QDeclarativeV8Handle callerFile(int frameIndex = 0) const
+ QQmlV8Handle callerFile(int frameIndex = 0) const
{
v8::Local<v8::StackTrace> stacks = v8::StackTrace::CurrentStackTrace(10, v8::StackTrace::kDetailed);
int count = stacks->GetFrameCount();
if (count >= frameIndex + 1) {
v8::Local<v8::StackFrame> frame = stacks->GetFrame(frameIndex + 1);
- return QDeclarativeV8Handle::fromHandle(frame->GetScriptNameOrSourceURL());
+ return QQmlV8Handle::fromHandle(frame->GetScriptNameOrSourceURL());
}
- return QDeclarativeV8Handle();
+ return QQmlV8Handle();
}
int callerLine(int frameIndex = 0) const
{
@@ -132,7 +132,7 @@ QML_DECLARE_TYPE(QuickTestUtil)
QT_BEGIN_NAMESPACE
-class QTestQmlModule : public QDeclarativeExtensionPlugin
+class QTestQmlModule : public QQmlExtensionPlugin
{
Q_OBJECT
public:
@@ -144,7 +144,7 @@ public:
qmlRegisterType<QuickTestUtil>(uri,1,0,"TestUtil");
}
- void initializeEngine(QDeclarativeEngine *, const char *)
+ void initializeEngine(QQmlEngine *, const char *)
{
}
};
diff --git a/src/imports/testlib/signalspy.h b/src/imports/testlib/signalspy.h
index 6b5166d8e0..6542203ce4 100644
--- a/src/imports/testlib/signalspy.h
+++ b/src/imports/testlib/signalspy.h
@@ -44,20 +44,20 @@
// This is a dummy header for defining the interface of "SignalSpy.qml" to qdoc.
-#include <QtDeclarative/qdeclarativeitem.h>
+#include <QtQuick/qquickitem.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-class SignalSpy : public QDeclarativeItem
+class SignalSpy : public QQuickItem
{
Q_OBJECT
Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged)
Q_PROPERTY(QString signalName READ signalName WRITE signalName NOTIFY signalNameChanged)
Q_PROPERTY(int count READ count countChanged)
public:
- SignalSpy(QDeclarativeItem *parent) : QDeclarativeItem(parent) {}
+ SignalSpy(QQuickItem *parent) : QQuickItem(parent) {}
~SignalSpy()
QObject *target() const;
diff --git a/src/imports/testlib/testcase.h b/src/imports/testlib/testcase.h
index 1793cca0f2..e7758ec9df 100644
--- a/src/imports/testlib/testcase.h
+++ b/src/imports/testlib/testcase.h
@@ -44,13 +44,13 @@
// This is a dummy header for defining the interface of "TestCase.qml" to qdoc.
-#include <QtDeclarative/qdeclarativeitem.h>
+#include <QtQuick/qquickitem.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-class TestCase : public QDeclarativeItem
+class TestCase : public QQuickItem
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
@@ -60,7 +60,7 @@ class TestCase : public QDeclarativeItem
Q_PROPERTY(bool running READ running NOTIFY runningChanged)
Q_PROPERTY(bool windowShown READ windowShown NOTIFY windowShownChanged)
public:
- TestCase(QDeclarativeItem *parent) : QDeclarativeItem(parent) {}
+ TestCase(QQuickItem *parent) : QQuickItem(parent) {}
~TestCase()
QString name() const;
diff --git a/src/imports/testlib/testlib.pro b/src/imports/testlib/testlib.pro
index 3b8a5bf75e..a4cb03466e 100644
--- a/src/imports/testlib/testlib.pro
+++ b/src/imports/testlib/testlib.pro
@@ -4,12 +4,12 @@ include(../qimportbase.pri)
CONFIG += qt plugin
-QT += declarative quick qmltest qmltest-private v8-private declarative-private core-private testlib
+QT += qml quick qmltest qmltest-private v8-private qml-private core-private testlib
SOURCES += main.cpp
HEADERS +=
-DESTDIR = $$QT.declarative.imports/$$TARGETPATH
+DESTDIR = $$QT.qml.imports/$$TARGETPATH
target.path += $$[QT_INSTALL_IMPORTS]/QtTest
OTHER_IMPORT_FILES = \
@@ -23,7 +23,7 @@ otherImportFiles.files += $$OTHER_IMPORT_FILES
otherImportFiles.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
copy2build.input = OTHER_IMPORT_FILES
-copy2build.output = $$QT.declarative.imports/$$TARGETPATH/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
+copy2build.output = $$QT.qml.imports/$$TARGETPATH/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
INSTALLS += target otherImportFiles
diff --git a/src/imports/xmllistmodel/plugin.cpp b/src/imports/xmllistmodel/plugin.cpp
index 9085a60885..54a6d5e212 100644
--- a/src/imports/xmllistmodel/plugin.cpp
+++ b/src/imports/xmllistmodel/plugin.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/
**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
+** This file is part of the QtQml module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
@@ -39,22 +39,22 @@
**
****************************************************************************/
-#include <QtDeclarative/qdeclarativeextensionplugin.h>
-#include <QtDeclarative/qdeclarative.h>
+#include <QtQml/qqmlextensionplugin.h>
+#include <QtQml/qqml.h>
-#include "qdeclarativexmllistmodel_p.h"
+#include "qqmlxmllistmodel_p.h"
QT_BEGIN_NAMESPACE
-class QmlXmlListModelPlugin : public QDeclarativeExtensionPlugin
+class QmlXmlListModelPlugin : public QQmlExtensionPlugin
{
Q_OBJECT
public:
virtual void registerTypes(const char *uri)
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.XmlListModel"));
- qmlRegisterType<QDeclarativeXmlListModel>(uri,2,0,"XmlListModel");
- qmlRegisterType<QDeclarativeXmlListModelRole>(uri,2,0,"XmlRole");
+ qmlRegisterType<QQuickXmlListModel>(uri,2,0,"XmlListModel");
+ qmlRegisterType<QQuickXmlListModelRole>(uri,2,0,"XmlRole");
}
};
diff --git a/src/imports/xmllistmodel/qdeclarativexmllistmodel.cpp b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
index db7fec2c97..1377859b5e 100644
--- a/src/imports/xmllistmodel/qdeclarativexmllistmodel.cpp
+++ b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/
**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
+** This file is part of the QtQml module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
@@ -39,10 +39,10 @@
**
****************************************************************************/
-#include "qdeclarativexmllistmodel_p.h"
+#include "qqmlxmllistmodel_p.h"
-#include <qdeclarativecontext.h>
-#include <private/qdeclarativeengine_p.h>
+#include <qqmlcontext.h>
+#include <private/qqmlengine_p.h>
#include <QDebug>
#include <QStringList>
@@ -59,22 +59,22 @@
#include <private/qobject_p.h>
-Q_DECLARE_METATYPE(QDeclarativeXmlQueryResult)
+Q_DECLARE_METATYPE(QQuickXmlQueryResult)
QT_BEGIN_NAMESPACE
-typedef QPair<int, int> QDeclarativeXmlListRange;
+typedef QPair<int, int> QQuickXmlListRange;
#define XMLLISTMODEL_CLEAR_ID 0
/*!
- \qmlclass XmlRole QDeclarativeXmlListModelRole
+ \qmlclass XmlRole QQuickXmlListModelRole
\inqmlmodule QtQuick 2
\ingroup qml-working-with-data
\brief The XmlRole element allows you to specify a role for an XmlListModel.
- \sa {QtDeclarative}
+ \sa {QtQml}
*/
/*!
@@ -111,12 +111,12 @@ typedef QPair<int, int> QDeclarativeXmlListRange;
For example, if there is an XML document like this:
- \quotefile doc/src/snippets/declarative/xmlrole.xml
+ \quotefile doc/src/snippets/qml/xmlrole.xml
Here are some valid XPath expressions for XmlRole queries on this document:
- \snippet doc/src/snippets/declarative/xmlrole.qml 0
+ \snippet doc/src/snippets/qml/xmlrole.qml 0
\dots 4
- \snippet doc/src/snippets/declarative/xmlrole.qml 1
+ \snippet doc/src/snippets/qml/xmlrole.qml 1
See the \l{http://www.w3.org/TR/xpath20/}{W3C XPath 2.0 specification} for more information.
*/
@@ -145,37 +145,37 @@ struct XmlQueryJob
};
-class QDeclarativeXmlQueryEngine;
-class QDeclarativeXmlQueryThreadObject : public QObject
+class QQuickXmlQueryEngine;
+class QQuickXmlQueryThreadObject : public QObject
{
Q_OBJECT
public:
- QDeclarativeXmlQueryThreadObject(QDeclarativeXmlQueryEngine *);
+ QQuickXmlQueryThreadObject(QQuickXmlQueryEngine *);
void processJobs();
virtual bool event(QEvent *e);
private:
- QDeclarativeXmlQueryEngine *m_queryEngine;
+ QQuickXmlQueryEngine *m_queryEngine;
};
-class QDeclarativeXmlQueryEngine : public QThread
+class QQuickXmlQueryEngine : public QThread
{
Q_OBJECT
public:
- QDeclarativeXmlQueryEngine(QDeclarativeEngine *eng);
- ~QDeclarativeXmlQueryEngine();
+ QQuickXmlQueryEngine(QQmlEngine *eng);
+ ~QQuickXmlQueryEngine();
- int doQuery(QString query, QString namespaces, QByteArray data, QList<QDeclarativeXmlListModelRole *>* roleObjects, QStringList keyRoleResultsCache);
+ int doQuery(QString query, QString namespaces, QByteArray data, QList<QQuickXmlListModelRole *>* roleObjects, QStringList keyRoleResultsCache);
void abort(int id);
void processJobs();
- static QDeclarativeXmlQueryEngine *instance(QDeclarativeEngine *engine);
+ static QQuickXmlQueryEngine *instance(QQmlEngine *engine);
signals:
- void queryCompleted(const QDeclarativeXmlQueryResult &);
+ void queryCompleted(const QQuickXmlQueryResult &);
void error(void*, const QString&);
protected:
@@ -183,38 +183,38 @@ protected:
private:
void processQuery(XmlQueryJob *job);
- void doQueryJob(XmlQueryJob *job, QDeclarativeXmlQueryResult *currentResult);
- void doSubQueryJob(XmlQueryJob *job, QDeclarativeXmlQueryResult *currentResult);
+ void doQueryJob(XmlQueryJob *job, QQuickXmlQueryResult *currentResult);
+ void doSubQueryJob(XmlQueryJob *job, QQuickXmlQueryResult *currentResult);
void getValuesOfKeyRoles(const XmlQueryJob& currentJob, QStringList *values, QXmlQuery *query) const;
- void addIndexToRangeList(QList<QDeclarativeXmlListRange> *ranges, int index) const;
+ void addIndexToRangeList(QList<QQuickXmlListRange> *ranges, int index) const;
QMutex m_mutex;
- QDeclarativeXmlQueryThreadObject *m_threadObject;
+ QQuickXmlQueryThreadObject *m_threadObject;
QList<XmlQueryJob> m_jobs;
QSet<int> m_cancelledJobs;
QAtomicInt m_queryIds;
- QDeclarativeEngine *m_engine;
+ QQmlEngine *m_engine;
QObject *m_eventLoopQuitHack;
- static QHash<QDeclarativeEngine *,QDeclarativeXmlQueryEngine*> queryEngines;
+ static QHash<QQmlEngine *,QQuickXmlQueryEngine*> queryEngines;
static QMutex queryEnginesMutex;
};
-QHash<QDeclarativeEngine *,QDeclarativeXmlQueryEngine*> QDeclarativeXmlQueryEngine::queryEngines;
-QMutex QDeclarativeXmlQueryEngine::queryEnginesMutex;
+QHash<QQmlEngine *,QQuickXmlQueryEngine*> QQuickXmlQueryEngine::queryEngines;
+QMutex QQuickXmlQueryEngine::queryEnginesMutex;
-QDeclarativeXmlQueryThreadObject::QDeclarativeXmlQueryThreadObject(QDeclarativeXmlQueryEngine *e)
+QQuickXmlQueryThreadObject::QQuickXmlQueryThreadObject(QQuickXmlQueryEngine *e)
: m_queryEngine(e)
{
}
-void QDeclarativeXmlQueryThreadObject::processJobs()
+void QQuickXmlQueryThreadObject::processJobs()
{
QCoreApplication::postEvent(this, new QEvent(QEvent::User));
}
-bool QDeclarativeXmlQueryThreadObject::event(QEvent *e)
+bool QQuickXmlQueryThreadObject::event(QEvent *e)
{
if (e->type() == QEvent::User) {
m_queryEngine->processJobs();
@@ -226,10 +226,10 @@ bool QDeclarativeXmlQueryThreadObject::event(QEvent *e)
-QDeclarativeXmlQueryEngine::QDeclarativeXmlQueryEngine(QDeclarativeEngine *eng)
+QQuickXmlQueryEngine::QQuickXmlQueryEngine(QQmlEngine *eng)
: QThread(eng), m_threadObject(0), m_queryIds(XMLLISTMODEL_CLEAR_ID + 1), m_engine(eng), m_eventLoopQuitHack(0)
{
- qRegisterMetaType<QDeclarativeXmlQueryResult>("QDeclarativeXmlQueryResult");
+ qRegisterMetaType<QQuickXmlQueryResult>("QQuickXmlQueryResult");
m_eventLoopQuitHack = new QObject;
m_eventLoopQuitHack->moveToThread(this);
@@ -237,7 +237,7 @@ QDeclarativeXmlQueryEngine::QDeclarativeXmlQueryEngine(QDeclarativeEngine *eng)
start(QThread::IdlePriority);
}
-QDeclarativeXmlQueryEngine::~QDeclarativeXmlQueryEngine()
+QQuickXmlQueryEngine::~QQuickXmlQueryEngine()
{
queryEnginesMutex.lock();
queryEngines.remove(m_engine);
@@ -247,7 +247,7 @@ QDeclarativeXmlQueryEngine::~QDeclarativeXmlQueryEngine()
wait();
}
-int QDeclarativeXmlQueryEngine::doQuery(QString query, QString namespaces, QByteArray data, QList<QDeclarativeXmlListModelRole *>* roleObjects, QStringList keyRoleResultsCache) {
+int QQuickXmlQueryEngine::doQuery(QString query, QString namespaces, QByteArray data, QList<QQuickXmlListModelRole *>* roleObjects, QStringList keyRoleResultsCache) {
{
QMutexLocker m1(&m_mutex);
m_queryIds.ref();
@@ -283,17 +283,17 @@ int QDeclarativeXmlQueryEngine::doQuery(QString query, QString namespaces, QByte
return job.queryId;
}
-void QDeclarativeXmlQueryEngine::abort(int id)
+void QQuickXmlQueryEngine::abort(int id)
{
QMutexLocker ml(&m_mutex);
if (id != -1)
m_cancelledJobs.insert(id);
}
-void QDeclarativeXmlQueryEngine::run()
+void QQuickXmlQueryEngine::run()
{
m_mutex.lock();
- m_threadObject = new QDeclarativeXmlQueryThreadObject(this);
+ m_threadObject = new QQuickXmlQueryThreadObject(this);
m_mutex.unlock();
processJobs();
@@ -303,7 +303,7 @@ void QDeclarativeXmlQueryEngine::run()
m_threadObject = 0;
}
-void QDeclarativeXmlQueryEngine::processJobs()
+void QQuickXmlQueryEngine::processJobs()
{
QMutexLocker locker(&m_mutex);
@@ -324,12 +324,12 @@ void QDeclarativeXmlQueryEngine::processJobs()
}
}
-QDeclarativeXmlQueryEngine *QDeclarativeXmlQueryEngine::instance(QDeclarativeEngine *engine)
+QQuickXmlQueryEngine *QQuickXmlQueryEngine::instance(QQmlEngine *engine)
{
queryEnginesMutex.lock();
- QDeclarativeXmlQueryEngine *queryEng = queryEngines.value(engine);
+ QQuickXmlQueryEngine *queryEng = queryEngines.value(engine);
if (!queryEng) {
- queryEng = new QDeclarativeXmlQueryEngine(engine);
+ queryEng = new QQuickXmlQueryEngine(engine);
queryEngines.insert(engine, queryEng);
}
queryEnginesMutex.unlock();
@@ -337,9 +337,9 @@ QDeclarativeXmlQueryEngine *QDeclarativeXmlQueryEngine::instance(QDeclarativeEng
return queryEng;
}
-void QDeclarativeXmlQueryEngine::processQuery(XmlQueryJob *job)
+void QQuickXmlQueryEngine::processQuery(XmlQueryJob *job)
{
- QDeclarativeXmlQueryResult result;
+ QQuickXmlQueryResult result;
result.queryId = job->queryId;
doQueryJob(job, &result);
doSubQueryJob(job, &result);
@@ -354,7 +354,7 @@ void QDeclarativeXmlQueryEngine::processQuery(XmlQueryJob *job)
}
}
-void QDeclarativeXmlQueryEngine::doQueryJob(XmlQueryJob *currentJob, QDeclarativeXmlQueryResult *currentResult)
+void QQuickXmlQueryEngine::doQueryJob(XmlQueryJob *currentJob, QQuickXmlQueryResult *currentResult)
{
Q_ASSERT(currentJob->queryId != -1);
@@ -393,7 +393,7 @@ void QDeclarativeXmlQueryEngine::doQueryJob(XmlQueryJob *currentJob, QDeclarativ
currentResult->size = (count > 0 ? count : 0);
}
-void QDeclarativeXmlQueryEngine::getValuesOfKeyRoles(const XmlQueryJob& currentJob, QStringList *values, QXmlQuery *query) const
+void QQuickXmlQueryEngine::getValuesOfKeyRoles(const XmlQueryJob& currentJob, QStringList *values, QXmlQuery *query) const
{
const QStringList &keysQueries = currentJob.keyRoleQueries;
QString keysQuery;
@@ -414,7 +414,7 @@ void QDeclarativeXmlQueryEngine::getValuesOfKeyRoles(const XmlQueryJob& currentJ
}
}
-void QDeclarativeXmlQueryEngine::addIndexToRangeList(QList<QDeclarativeXmlListRange> *ranges, int index) const {
+void QQuickXmlQueryEngine::addIndexToRangeList(QList<QQuickXmlListRange> *ranges, int index) const {
if (ranges->isEmpty())
ranges->append(qMakePair(index, 1));
else if (ranges->last().first + ranges->last().second == index)
@@ -423,7 +423,7 @@ void QDeclarativeXmlQueryEngine::addIndexToRangeList(QList<QDeclarativeXmlListRa
ranges->append(qMakePair(index, 1));
}
-void QDeclarativeXmlQueryEngine::doSubQueryJob(XmlQueryJob *currentJob, QDeclarativeXmlQueryResult *currentResult)
+void QQuickXmlQueryEngine::doSubQueryJob(XmlQueryJob *currentJob, QQuickXmlQueryResult *currentResult)
{
Q_ASSERT(currentJob->queryId != -1);
@@ -489,7 +489,7 @@ void QDeclarativeXmlQueryEngine::doSubQueryJob(XmlQueryJob *currentJob, QDeclara
/*for (int j = 0; j < m_size; ++j) {
QList<QVariant> resultList;
for (int i = 0; i < m_roleObjects->size(); ++i) {
- QDeclarativeXmlListModelRole *role = m_roleObjects->at(i);
+ QQuickXmlListModelRole *role = m_roleObjects->at(i);
subquery.setQuery(m_prefix.arg(j+1) + role->query());
if (role->isStringList()) {
QStringList data;
@@ -514,27 +514,27 @@ void QDeclarativeXmlQueryEngine::doSubQueryJob(XmlQueryJob *currentJob, QDeclara
}*/
}
-class QDeclarativeXmlListModelPrivate : public QObjectPrivate
+class QQuickXmlListModelPrivate : public QObjectPrivate
{
- Q_DECLARE_PUBLIC(QDeclarativeXmlListModel)
+ Q_DECLARE_PUBLIC(QQuickXmlListModel)
public:
- QDeclarativeXmlListModelPrivate()
+ QQuickXmlListModelPrivate()
: isComponentComplete(true), size(-1), highestRole(Qt::UserRole)
- , reply(0), status(QDeclarativeXmlListModel::Null), progress(0.0)
+ , reply(0), status(QQuickXmlListModel::Null), progress(0.0)
, queryId(-1), roleObjects(), redirectCount(0) {}
void notifyQueryStarted(bool remoteSource) {
- Q_Q(QDeclarativeXmlListModel);
+ Q_Q(QQuickXmlListModel);
progress = remoteSource ? 0.0 : 1.0;
- status = QDeclarativeXmlListModel::Loading;
+ status = QQuickXmlListModel::Loading;
errorString.clear();
emit q->progressChanged(progress);
emit q->statusChanged(status);
}
void deleteReply() {
- Q_Q(QDeclarativeXmlListModel);
+ Q_Q(QQuickXmlListModel);
if (reply) {
QObject::disconnect(reply, 0, q, 0);
reply->deleteLater();
@@ -553,23 +553,23 @@ public:
int highestRole;
QNetworkReply *reply;
- QDeclarativeXmlListModel::Status status;
+ QQuickXmlListModel::Status status;
QString errorString;
qreal progress;
int queryId;
QStringList keyRoleResultsCache;
- QList<QDeclarativeXmlListModelRole *> roleObjects;
+ QList<QQuickXmlListModelRole *> roleObjects;
- static void append_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list, QDeclarativeXmlListModelRole *role);
- static void clear_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list);
+ static void append_role(QQmlListProperty<QQuickXmlListModelRole> *list, QQuickXmlListModelRole *role);
+ static void clear_role(QQmlListProperty<QQuickXmlListModelRole> *list);
QList<QList<QVariant> > data;
int redirectCount;
};
-void QDeclarativeXmlListModelPrivate::append_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list, QDeclarativeXmlListModelRole *role)
+void QQuickXmlListModelPrivate::append_role(QQmlListProperty<QQuickXmlListModelRole> *list, QQuickXmlListModelRole *role)
{
- QDeclarativeXmlListModel *_this = qobject_cast<QDeclarativeXmlListModel *>(list->object);
+ QQuickXmlListModel *_this = qobject_cast<QQuickXmlListModel *>(list->object);
if (_this && role) {
int i = _this->d_func()->roleObjects.count();
_this->d_func()->roleObjects.append(role);
@@ -585,16 +585,16 @@ void QDeclarativeXmlListModelPrivate::append_role(QDeclarativeListProperty<QDecl
//### clear needs to invalidate any cached data (in data table) as well
// (and the model should emit the appropriate signals)
-void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list)
+void QQuickXmlListModelPrivate::clear_role(QQmlListProperty<QQuickXmlListModelRole> *list)
{
- QDeclarativeXmlListModel *_this = static_cast<QDeclarativeXmlListModel *>(list->object);
+ QQuickXmlListModel *_this = static_cast<QQuickXmlListModel *>(list->object);
_this->d_func()->roles.clear();
_this->d_func()->roleNames.clear();
_this->d_func()->roleObjects.clear();
}
/*!
- \qmlclass XmlListModel QDeclarativeXmlListModel
+ \qmlclass XmlListModel QQuickXmlListModel
\inqmlmodule QtQuick 2
\ingroup qml-working-with-data
\brief The XmlListModel element is used to specify a read-only model using XPath expressions.
@@ -690,12 +690,12 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla
\sa {RSS News}
*/
-QDeclarativeXmlListModel::QDeclarativeXmlListModel(QObject *parent)
- : QListModelInterface(*(new QDeclarativeXmlListModelPrivate), parent)
+QQuickXmlListModel::QQuickXmlListModel(QObject *parent)
+ : QListModelInterface(*(new QQuickXmlListModelPrivate), parent)
{
}
-QDeclarativeXmlListModel::~QDeclarativeXmlListModel()
+QQuickXmlListModel::~QQuickXmlListModel()
{
}
@@ -704,18 +704,18 @@ QDeclarativeXmlListModel::~QDeclarativeXmlListModel()
The roles to make available for this model.
*/
-QDeclarativeListProperty<QDeclarativeXmlListModelRole> QDeclarativeXmlListModel::roleObjects()
+QQmlListProperty<QQuickXmlListModelRole> QQuickXmlListModel::roleObjects()
{
- Q_D(QDeclarativeXmlListModel);
- QDeclarativeListProperty<QDeclarativeXmlListModelRole> list(this, d->roleObjects);
- list.append = &QDeclarativeXmlListModelPrivate::append_role;
- list.clear = &QDeclarativeXmlListModelPrivate::clear_role;
+ Q_D(QQuickXmlListModel);
+ QQmlListProperty<QQuickXmlListModelRole> list(this, d->roleObjects);
+ list.append = &QQuickXmlListModelPrivate::append_role;
+ list.clear = &QQuickXmlListModelPrivate::clear_role;
return list;
}
-QHash<int,QVariant> QDeclarativeXmlListModel::data(int index, const QList<int> &roles) const
+QHash<int,QVariant> QQuickXmlListModel::data(int index, const QList<int> &roles) const
{
- Q_D(const QDeclarativeXmlListModel);
+ Q_D(const QQuickXmlListModel);
QHash<int, QVariant> rv;
for (int i = 0; i < roles.size(); ++i) {
int role = roles.at(i);
@@ -725,9 +725,9 @@ QHash<int,QVariant> QDeclarativeXmlListModel::data(int index, const QList<int> &
return rv;
}
-QVariant QDeclarativeXmlListModel::data(int index, int role) const
+QVariant QQuickXmlListModel::data(int index, int role) const
{
- Q_D(const QDeclarativeXmlListModel);
+ Q_D(const QQuickXmlListModel);
int roleIndex = d->roles.indexOf(role);
return (roleIndex == -1) ? QVariant() : d->data.value(roleIndex).value(index);
}
@@ -736,21 +736,21 @@ QVariant QDeclarativeXmlListModel::data(int index, int role) const
\qmlproperty int QtQuick2::XmlListModel::count
The number of data entries in the model.
*/
-int QDeclarativeXmlListModel::count() const
+int QQuickXmlListModel::count() const
{
- Q_D(const QDeclarativeXmlListModel);
+ Q_D(const QQuickXmlListModel);
return d->size;
}
-QList<int> QDeclarativeXmlListModel::roles() const
+QList<int> QQuickXmlListModel::roles() const
{
- Q_D(const QDeclarativeXmlListModel);
+ Q_D(const QQuickXmlListModel);
return d->roles;
}
-QString QDeclarativeXmlListModel::toString(int role) const
+QString QQuickXmlListModel::toString(int role) const
{
- Q_D(const QDeclarativeXmlListModel);
+ Q_D(const QQuickXmlListModel);
int index = d->roles.indexOf(role);
if (index == -1)
return QString();
@@ -763,15 +763,15 @@ QString QDeclarativeXmlListModel::toString(int role) const
If both \c source and \l xml are set, \l xml is used.
*/
-QUrl QDeclarativeXmlListModel::source() const
+QUrl QQuickXmlListModel::source() const
{
- Q_D(const QDeclarativeXmlListModel);
+ Q_D(const QQuickXmlListModel);
return d->src;
}
-void QDeclarativeXmlListModel::setSource(const QUrl &src)
+void QQuickXmlListModel::setSource(const QUrl &src)
{
- Q_D(QDeclarativeXmlListModel);
+ Q_D(QQuickXmlListModel);
if (d->src != src) {
d->src = src;
if (d->xml.isEmpty()) // src is only used if d->xml is not set
@@ -788,15 +788,15 @@ void QDeclarativeXmlListModel::setSource(const QUrl &src)
If both \l source and \c xml are set, \c xml is used.
*/
-QString QDeclarativeXmlListModel::xml() const
+QString QQuickXmlListModel::xml() const
{
- Q_D(const QDeclarativeXmlListModel);
+ Q_D(const QQuickXmlListModel);
return d->xml;
}
-void QDeclarativeXmlListModel::setXml(const QString &xml)
+void QQuickXmlListModel::setXml(const QString &xml)
{
- Q_D(QDeclarativeXmlListModel);
+ Q_D(QQuickXmlListModel);
if (d->xml != xml) {
d->xml = xml;
reload();
@@ -809,17 +809,17 @@ void QDeclarativeXmlListModel::setXml(const QString &xml)
An absolute XPath query representing the base query for creating model items
from this model's XmlRole objects. The query should start with '/' or '//'.
*/
-QString QDeclarativeXmlListModel::query() const
+QString QQuickXmlListModel::query() const
{
- Q_D(const QDeclarativeXmlListModel);
+ Q_D(const QQuickXmlListModel);
return d->query;
}
-void QDeclarativeXmlListModel::setQuery(const QString &query)
+void QQuickXmlListModel::setQuery(const QString &query)
{
- Q_D(QDeclarativeXmlListModel);
+ Q_D(QQuickXmlListModel);
if (!query.startsWith(QLatin1Char('/'))) {
- qmlInfo(this) << QCoreApplication::translate("QDeclarativeXmlRoleList", "An XmlListModel query must start with '/' or \"//\"");
+ qmlInfo(this) << QCoreApplication::translate("QQuickXmlRoleList", "An XmlListModel query must start with '/' or \"//\"");
return;
}
@@ -848,15 +848,15 @@ void QDeclarativeXmlListModel::setQuery(const QString &query)
}
\endqml
*/
-QString QDeclarativeXmlListModel::namespaceDeclarations() const
+QString QQuickXmlListModel::namespaceDeclarations() const
{
- Q_D(const QDeclarativeXmlListModel);
+ Q_D(const QQuickXmlListModel);
return d->namespaces;
}
-void QDeclarativeXmlListModel::setNamespaceDeclarations(const QString &declarations)
+void QQuickXmlListModel::setNamespaceDeclarations(const QString &declarations)
{
- Q_D(QDeclarativeXmlListModel);
+ Q_D(QQuickXmlListModel);
if (d->namespaces != declarations) {
d->namespaces = declarations;
reload();
@@ -886,22 +886,22 @@ void QDeclarativeXmlListModel::setNamespaceDeclarations(const QString &declarati
var title = model.get(0).title;
\endjs
*/
-QDeclarativeV8Handle QDeclarativeXmlListModel::get(int index) const
+QQmlV8Handle QQuickXmlListModel::get(int index) const
{
// Must be called with a context and handle scope
- Q_D(const QDeclarativeXmlListModel);
+ Q_D(const QQuickXmlListModel);
if (index < 0 || index >= count())
- return QDeclarativeV8Handle::fromHandle(v8::Undefined());
+ return QQmlV8Handle::fromHandle(v8::Undefined());
- QDeclarativeEngine *engine = qmlContext(this)->engine();
- QV8Engine *v8engine = QDeclarativeEnginePrivate::getV8Engine(engine);
+ QQmlEngine *engine = qmlContext(this)->engine();
+ QV8Engine *v8engine = QQmlEnginePrivate::getV8Engine(engine);
v8::Local<v8::Object> rv = v8::Object::New();
for (int ii = 0; ii < d->roleObjects.count(); ++ii)
rv->Set(v8engine->toString(d->roleObjects[ii]->name()),
v8engine->fromVariant(d->data.value(ii).value(index)));
- return QDeclarativeV8Handle::fromHandle(rv);
+ return QQmlV8Handle::fromHandle(rv);
}
/*!
@@ -919,9 +919,9 @@ QDeclarativeV8Handle QDeclarativeXmlListModel::get(int index) const
\sa progress
*/
-QDeclarativeXmlListModel::Status QDeclarativeXmlListModel::status() const
+QQuickXmlListModel::Status QQuickXmlListModel::status() const
{
- Q_D(const QDeclarativeXmlListModel);
+ Q_D(const QQuickXmlListModel);
return d->status;
}
@@ -940,9 +940,9 @@ QDeclarativeXmlListModel::Status QDeclarativeXmlListModel::status() const
\sa status, source
*/
-qreal QDeclarativeXmlListModel::progress() const
+qreal QQuickXmlListModel::progress() const
{
- Q_D(const QDeclarativeXmlListModel);
+ Q_D(const QQuickXmlListModel);
return d->progress;
}
@@ -952,27 +952,27 @@ qreal QDeclarativeXmlListModel::progress() const
Returns a string description of the last error that occurred
if \l status is XmlListModel::Error.
*/
-QString QDeclarativeXmlListModel::errorString() const
+QString QQuickXmlListModel::errorString() const
{
- Q_D(const QDeclarativeXmlListModel);
+ Q_D(const QQuickXmlListModel);
return d->errorString;
}
-void QDeclarativeXmlListModel::classBegin()
+void QQuickXmlListModel::classBegin()
{
- Q_D(QDeclarativeXmlListModel);
+ Q_D(QQuickXmlListModel);
d->isComponentComplete = false;
- QDeclarativeXmlQueryEngine *queryEngine = QDeclarativeXmlQueryEngine::instance(qmlEngine(this));
- connect(queryEngine, SIGNAL(queryCompleted(QDeclarativeXmlQueryResult)),
- SLOT(queryCompleted(QDeclarativeXmlQueryResult)));
+ QQuickXmlQueryEngine *queryEngine = QQuickXmlQueryEngine::instance(qmlEngine(this));
+ connect(queryEngine, SIGNAL(queryCompleted(QQuickXmlQueryResult)),
+ SLOT(queryCompleted(QQuickXmlQueryResult)));
connect(queryEngine, SIGNAL(error(void*,QString)),
SLOT(queryError(void*,QString)));
}
-void QDeclarativeXmlListModel::componentComplete()
+void QQuickXmlListModel::componentComplete()
{
- Q_D(QDeclarativeXmlListModel);
+ Q_D(QQuickXmlListModel);
d->isComponentComplete = true;
reload();
}
@@ -990,14 +990,14 @@ void QDeclarativeXmlListModel::componentComplete()
\sa {Using key XML roles}, XmlRole::isKey
*/
-void QDeclarativeXmlListModel::reload()
+void QQuickXmlListModel::reload()
{
- Q_D(QDeclarativeXmlListModel);
+ Q_D(QQuickXmlListModel);
if (!d->isComponentComplete)
return;
- QDeclarativeXmlQueryEngine::instance(qmlEngine(this))->abort(d->queryId);
+ QQuickXmlQueryEngine::instance(qmlEngine(this))->abort(d->queryId);
d->queryId = -1;
if (d->size < 0)
@@ -1009,7 +1009,7 @@ void QDeclarativeXmlListModel::reload()
}
if (!d->xml.isEmpty()) {
- d->queryId = QDeclarativeXmlQueryEngine::instance(qmlEngine(this))->doQuery(d->query, d->namespaces, d->xml.toUtf8(), &d->roleObjects, d->keyRoleResultsCache);
+ d->queryId = QQuickXmlQueryEngine::instance(qmlEngine(this))->doQuery(d->query, d->namespaces, d->xml.toUtf8(), &d->roleObjects, d->keyRoleResultsCache);
d->notifyQueryStarted(false);
} else if (d->src.isEmpty()) {
@@ -1030,9 +1030,9 @@ void QDeclarativeXmlListModel::reload()
#define XMLLISTMODEL_MAX_REDIRECT 16
-void QDeclarativeXmlListModel::requestFinished()
+void QQuickXmlListModel::requestFinished()
{
- Q_D(QDeclarativeXmlListModel);
+ Q_D(QQuickXmlListModel);
d->redirectCount++;
if (d->redirectCount < XMLLISTMODEL_MAX_REDIRECT) {
@@ -1067,7 +1067,7 @@ void QDeclarativeXmlListModel::requestFinished()
d->queryId = XMLLISTMODEL_CLEAR_ID;
QTimer::singleShot(0, this, SLOT(dataCleared()));
} else {
- d->queryId = QDeclarativeXmlQueryEngine::instance(qmlEngine(this))->doQuery(d->query, d->namespaces, data, &d->roleObjects, d->keyRoleResultsCache);
+ d->queryId = QQuickXmlQueryEngine::instance(qmlEngine(this))->doQuery(d->query, d->namespaces, data, &d->roleObjects, d->keyRoleResultsCache);
}
d->deleteReply();
@@ -1076,19 +1076,19 @@ void QDeclarativeXmlListModel::requestFinished()
}
}
-void QDeclarativeXmlListModel::requestProgress(qint64 received, qint64 total)
+void QQuickXmlListModel::requestProgress(qint64 received, qint64 total)
{
- Q_D(QDeclarativeXmlListModel);
+ Q_D(QQuickXmlListModel);
if (d->status == Loading && total > 0) {
d->progress = qreal(received)/total;
emit progressChanged(d->progress);
}
}
-void QDeclarativeXmlListModel::dataCleared()
+void QQuickXmlListModel::dataCleared()
{
- Q_D(QDeclarativeXmlListModel);
- QDeclarativeXmlQueryResult r;
+ Q_D(QQuickXmlListModel);
+ QQuickXmlQueryResult r;
r.queryId = XMLLISTMODEL_CLEAR_ID;
r.size = 0;
r.removed << qMakePair(0, count());
@@ -1096,12 +1096,12 @@ void QDeclarativeXmlListModel::dataCleared()
queryCompleted(r);
}
-void QDeclarativeXmlListModel::queryError(void* object, const QString& error)
+void QQuickXmlListModel::queryError(void* object, const QString& error)
{
// Be extra careful, object may no longer exist, it's just an ID.
- Q_D(QDeclarativeXmlListModel);
+ Q_D(QQuickXmlListModel);
for (int i=0; i<d->roleObjects.count(); i++) {
- if (d->roleObjects.at(i) == static_cast<QDeclarativeXmlListModelRole*>(object)) {
+ if (d->roleObjects.at(i) == static_cast<QQuickXmlListModelRole*>(object)) {
qmlInfo(d->roleObjects.at(i)) << QObject::tr("invalid query: \"%1\"").arg(error);
return;
}
@@ -1109,9 +1109,9 @@ void QDeclarativeXmlListModel::queryError(void* object, const QString& error)
qmlInfo(this) << QObject::tr("invalid query: \"%1\"").arg(error);
}
-void QDeclarativeXmlListModel::queryCompleted(const QDeclarativeXmlQueryResult &result)
+void QQuickXmlListModel::queryCompleted(const QQuickXmlQueryResult &result)
{
- Q_D(QDeclarativeXmlListModel);
+ Q_D(QQuickXmlListModel);
if (result.queryId != d->queryId)
return;
@@ -1157,4 +1157,4 @@ void QDeclarativeXmlListModel::queryCompleted(const QDeclarativeXmlQueryResult &
QT_END_NAMESPACE
-#include <qdeclarativexmllistmodel.moc>
+#include <qqmlxmllistmodel.moc>
diff --git a/src/imports/xmllistmodel/qdeclarativexmllistmodel_p.h b/src/imports/xmllistmodel/qqmlxmllistmodel_p.h
index f34591d0a3..5bc4c7b494 100644
--- a/src/imports/xmllistmodel/qdeclarativexmllistmodel_p.h
+++ b/src/imports/xmllistmodel/qqmlxmllistmodel_p.h
@@ -3,7 +3,7 @@
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/
**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
+** This file is part of the QtQml module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
@@ -39,11 +39,11 @@
**
****************************************************************************/
-#ifndef QDECLARATIVEXMLLISTMODEL_H
-#define QDECLARATIVEXMLLISTMODEL_H
+#ifndef QQUICKXMLLISTMODEL_H
+#define QQUICKXMLLISTMODEL_H
-#include <qdeclarative.h>
-#include <qdeclarativeinfo.h>
+#include <qqml.h>
+#include <qqmlinfo.h>
#include <QtCore/qurl.h>
#include <QtCore/qstringlist.h>
@@ -56,11 +56,11 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-class QDeclarativeContext;
-class QDeclarativeXmlListModelRole;
-class QDeclarativeXmlListModelPrivate;
+class QQmlContext;
+class QQuickXmlListModelRole;
+class QQuickXmlListModelPrivate;
-struct QDeclarativeXmlQueryResult {
+struct QQuickXmlQueryResult {
int queryId;
int size;
QList<QList<QVariant> > data;
@@ -69,10 +69,10 @@ struct QDeclarativeXmlQueryResult {
QStringList keyRoleResultsCache;
};
-class QDeclarativeXmlListModel : public QListModelInterface, public QDeclarativeParserStatus
+class QQuickXmlListModel : public QListModelInterface, public QQmlParserStatus
{
Q_OBJECT
- Q_INTERFACES(QDeclarativeParserStatus)
+ Q_INTERFACES(QQmlParserStatus)
Q_ENUMS(Status)
Q_PROPERTY(Status status READ status NOTIFY statusChanged)
@@ -81,13 +81,13 @@ class QDeclarativeXmlListModel : public QListModelInterface, public QDeclarative
Q_PROPERTY(QString xml READ xml WRITE setXml NOTIFY xmlChanged)
Q_PROPERTY(QString query READ query WRITE setQuery NOTIFY queryChanged)
Q_PROPERTY(QString namespaceDeclarations READ namespaceDeclarations WRITE setNamespaceDeclarations NOTIFY namespaceDeclarationsChanged)
- Q_PROPERTY(QDeclarativeListProperty<QDeclarativeXmlListModelRole> roles READ roleObjects)
+ Q_PROPERTY(QQmlListProperty<QQuickXmlListModelRole> roles READ roleObjects)
Q_PROPERTY(int count READ count NOTIFY countChanged)
Q_CLASSINFO("DefaultProperty", "roles")
public:
- QDeclarativeXmlListModel(QObject *parent = 0);
- ~QDeclarativeXmlListModel();
+ QQuickXmlListModel(QObject *parent = 0);
+ ~QQuickXmlListModel();
virtual QHash<int,QVariant> data(int index, const QList<int> &roles = (QList<int>())) const;
virtual QVariant data(int index, int role) const;
@@ -95,7 +95,7 @@ public:
virtual QList<int> roles() const;
virtual QString toString(int role) const;
- QDeclarativeListProperty<QDeclarativeXmlListModelRole> roleObjects();
+ QQmlListProperty<QQuickXmlListModelRole> roleObjects();
QUrl source() const;
void setSource(const QUrl&);
@@ -109,7 +109,7 @@ public:
QString namespaceDeclarations() const;
void setNamespaceDeclarations(const QString&);
- Q_INVOKABLE QDeclarativeV8Handle get(int index) const;
+ Q_INVOKABLE QQmlV8Handle get(int index) const;
enum Status { Null, Ready, Loading, Error };
Status status() const;
@@ -121,7 +121,7 @@ public:
virtual void componentComplete();
Q_SIGNALS:
- void statusChanged(QDeclarativeXmlListModel::Status);
+ void statusChanged(QQuickXmlListModel::Status);
void progressChanged(qreal progress);
void countChanged();
void sourceChanged();
@@ -140,23 +140,23 @@ private Q_SLOTS:
void requestFinished();
void requestProgress(qint64,qint64);
void dataCleared();
- void queryCompleted(const QDeclarativeXmlQueryResult &);
+ void queryCompleted(const QQuickXmlQueryResult &);
void queryError(void* object, const QString& error);
private:
- Q_DECLARE_PRIVATE(QDeclarativeXmlListModel)
- Q_DISABLE_COPY(QDeclarativeXmlListModel)
+ Q_DECLARE_PRIVATE(QQuickXmlListModel)
+ Q_DISABLE_COPY(QQuickXmlListModel)
};
-class QDeclarativeXmlListModelRole : public QObject
+class QQuickXmlListModelRole : public QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(QString query READ query WRITE setQuery NOTIFY queryChanged)
Q_PROPERTY(bool isKey READ isKey WRITE setIsKey NOTIFY isKeyChanged)
public:
- QDeclarativeXmlListModelRole() : m_isKey(false) {}
- ~QDeclarativeXmlListModelRole() {}
+ QQuickXmlListModelRole() : m_isKey(false) {}
+ ~QQuickXmlListModelRole() {}
QString name() const { return m_name; }
void setName(const QString &name) {
@@ -204,9 +204,9 @@ private:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QDeclarativeXmlListModel)
-QML_DECLARE_TYPE(QDeclarativeXmlListModelRole)
+QML_DECLARE_TYPE(QQuickXmlListModel)
+QML_DECLARE_TYPE(QQuickXmlListModelRole)
QT_END_HEADER
-#endif // QDECLARATIVEXMLLISTMODEL_H
+#endif // QQUICKXMLLISTMODEL_H
diff --git a/src/imports/xmllistmodel/xmllistmodel.pro b/src/imports/xmllistmodel/xmllistmodel.pro
index d8121e8db8..8c056e8448 100644
--- a/src/imports/xmllistmodel/xmllistmodel.pro
+++ b/src/imports/xmllistmodel/xmllistmodel.pro
@@ -2,12 +2,12 @@ TARGET = qmlxmllistmodelplugin
TARGETPATH = QtQuick/XmlListModel
include(../qimportbase.pri)
-QT += network declarative xmlpatterns declarative-private v8-private core-private
+QT += network qml xmlpatterns qml-private v8-private core-private
-SOURCES += qdeclarativexmllistmodel.cpp plugin.cpp
-HEADERS += qdeclarativexmllistmodel_p.h
+SOURCES += qqmlxmllistmodel.cpp plugin.cpp
+HEADERS += qqmlxmllistmodel_p.h
-DESTDIR = $$QT.declarative.imports/$$TARGETPATH
+DESTDIR = $$QT.qml.imports/$$TARGETPATH
target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
qmldir.files += $$PWD/qmldir