aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorAlan Alpert <aalpert@rim.com>2013-01-10 14:07:37 -0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-24 17:14:12 +0100
commitbbb3d5b403511f6e0bc1966835983b2574596e25 (patch)
tree18af25145c1eb0474f0bac6531d9ec8ae4361c3b /src/qml
parenteab53ad9fe0aa9664702d446a704256f46106c56 (diff)
Move ListModel and ListElement to the QtQml import
They're already in the QtQml module, but were left in the QtQuick import because they were considered to be of minimal use without QtQuick types. QtQml types are being developed would could make ListModel useful without QtQuick, indicating that they should no longer be considered QtQuick depedent. Change-Id: I31499f2cc23baf4bc70fb451ba164408bed89ff6 Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/qml/qml.pri10
-rw-r--r--src/qml/qml/qqmlengine.cpp6
-rw-r--r--src/qml/qml/qqmllistmodel.cpp (renamed from src/qml/qml/qquicklistmodel.cpp)162
-rw-r--r--src/qml/qml/qqmllistmodel_p.h (renamed from src/qml/qml/qquicklistmodel_p.h)40
-rw-r--r--src/qml/qml/qqmllistmodel_p_p.h (renamed from src/qml/qml/qquicklistmodel_p_p.h)30
-rw-r--r--src/qml/qml/qqmllistmodelworkeragent.cpp (renamed from src/qml/qml/qquicklistmodelworkeragent.cpp)56
-rw-r--r--src/qml/qml/qqmllistmodelworkeragent_p.h (renamed from src/qml/qml/qquicklistmodelworkeragent_p.h)22
-rw-r--r--src/qml/qml/qquickworkerscript.cpp6
-rw-r--r--src/qml/qml/v8/qv8worker.cpp12
9 files changed, 172 insertions, 172 deletions
diff --git a/src/qml/qml/qml.pri b/src/qml/qml/qml.pri
index 20b46f0939..87fe47750f 100644
--- a/src/qml/qml/qml.pri
+++ b/src/qml/qml/qml.pri
@@ -1,7 +1,7 @@
SOURCES += \
$$PWD/qqmlinstruction.cpp \
- $$PWD/qquicklistmodel.cpp \
- $$PWD/qquicklistmodelworkeragent.cpp \
+ $$PWD/qqmllistmodel.cpp \
+ $$PWD/qqmllistmodelworkeragent.cpp \
$$PWD/qqmlopenmetaobject.cpp \
$$PWD/qqmlvmemetaobject.cpp \
$$PWD/qqmlengine.cpp \
@@ -60,9 +60,9 @@ SOURCES += \
HEADERS += \
$$PWD/qqmlglobal_p.h \
$$PWD/qqmlinstruction_p.h \
- $$PWD/qquicklistmodel_p.h\
- $$PWD/qquicklistmodel_p_p.h\
- $$PWD/qquicklistmodelworkeragent_p.h \
+ $$PWD/qqmllistmodel_p.h\
+ $$PWD/qqmllistmodel_p_p.h\
+ $$PWD/qqmllistmodelworkeragent_p.h \
$$PWD/qqmlopenmetaobject_p.h \
$$PWD/qqmlvmemetaobject_p.h \
$$PWD/qqml.h \
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 145818aadf..600f526c45 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -55,7 +55,7 @@
#include "qqmlxmlhttprequest_p.h"
#include "qqmlscriptstring.h"
#include "qqmlglobal_p.h"
-#include "qquicklistmodel_p.h"
+#include "qqmllistmodel_p.h"
#include "qquickworkerscript_p.h"
#include "qqmlcomponent_p.h"
#include "qqmlnetworkaccessmanagerfactory.h"
@@ -180,14 +180,14 @@ void QQmlEnginePrivate::registerBaseTypes(const char *uri, int versionMajor, int
qmlRegisterType<QQmlConnections>(uri, versionMajor, versionMinor,"Connections");
qmlRegisterType<QQmlTimer>(uri, versionMajor, versionMinor,"Timer");
qmlRegisterCustomType<QQmlConnections>(uri, versionMajor, versionMinor,"Connections", new QQmlConnectionsParser);
+ qmlRegisterType<QQmlListElement>(uri, versionMajor, versionMinor, "ListElement");
+ qmlRegisterCustomType<QQmlListModel>(uri, versionMajor, versionMinor, "ListModel", new QQmlListModelParser);
}
// These QtQuick types' implementation resides in the QtQml module
void QQmlEnginePrivate::registerQtQuick2Types(const char *uri, int versionMajor, int versionMinor)
{
- qmlRegisterType<QQuickListElement>(uri, versionMajor, versionMinor, "ListElement");
- qmlRegisterCustomType<QQuickListModel>(uri, versionMajor, versionMinor, "ListModel", new QQuickListModelParser);
qmlRegisterType<QQuickWorkerScript>(uri, versionMajor, versionMinor, "WorkerScript");
}
diff --git a/src/qml/qml/qquicklistmodel.cpp b/src/qml/qml/qqmllistmodel.cpp
index 91c1a9c476..5d64d37768 100644
--- a/src/qml/qml/qquicklistmodel.cpp
+++ b/src/qml/qml/qqmllistmodel.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#include "qquicklistmodel_p_p.h"
-#include "qquicklistmodelworkeragent_p.h"
+#include "qqmllistmodel_p_p.h"
+#include "qqmllistmodelworkeragent_p.h"
#include "qqmlopenmetaobject_p.h"
#include <private/qqmljsast_p.h>
#include <private/qqmljsengine_p.h>
@@ -246,7 +246,7 @@ const ListLayout::Role *ListLayout::getExistingRole(v8::Handle<v8::String> key)
return r;
}
-ModelObject *ListModel::getOrCreateModelObject(QQuickListModel *model, int elementIndex)
+ModelObject *ListModel::getOrCreateModelObject(QQmlListModel *model, int elementIndex)
{
ListElement *e = elements[elementIndex];
if (e->m_objectCache == 0) {
@@ -326,7 +326,7 @@ void ListModel::sync(ListModel *src, ListModel *target, QHash<int, ListModel *>
}
}
-ListModel::ListModel(ListLayout *layout, QQuickListModel *modelCache, int uid) : m_layout(layout), m_modelCache(modelCache)
+ListModel::ListModel(ListLayout *layout, QQmlListModel *modelCache, int uid) : m_layout(layout), m_modelCache(modelCache)
{
if (uid == -1)
uid = uidCounter.fetchAndAddOrdered(1);
@@ -394,7 +394,7 @@ void ListModel::updateCacheIndices()
}
}
-QVariant ListModel::getProperty(int elementIndex, int roleIndex, const QQuickListModel *owner, QV8Engine *eng)
+QVariant ListModel::getProperty(int elementIndex, int roleIndex, const QQmlListModel *owner, QV8Engine *eng)
{
ListElement *e = elements[elementIndex];
const ListLayout::Role &r = m_layout->getExistingRole(roleIndex);
@@ -698,7 +698,7 @@ ListModel *ListElement::getListProperty(const ListLayout::Role &role)
return *value;
}
-QVariant ListElement::getProperty(const ListLayout::Role &role, const QQuickListModel *owner, QV8Engine *eng)
+QVariant ListElement::getProperty(const ListLayout::Role &role, const QQmlListModel *owner, QV8Engine *eng)
{
char *mem = getPropertyMemory(role);
@@ -731,7 +731,7 @@ QVariant ListElement::getProperty(const ListLayout::Role &role, const QQuickList
if (model) {
if (model->m_modelCache == 0) {
- model->m_modelCache = new QQuickListModel(owner, model, eng);
+ model->m_modelCache = new QQmlListModel(owner, model, eng);
QQmlEngine::setContextForObject(model->m_modelCache, QQmlEngine::contextForObject(owner));
}
@@ -1207,7 +1207,7 @@ int ListElement::setJsProperty(const ListLayout::Role &role, v8::Handle<v8::Valu
return roleIndex;
}
-ModelObject::ModelObject(QQuickListModel *model, int elementIndex)
+ModelObject::ModelObject(QQmlListModel *model, int elementIndex)
: m_model(model), m_elementIndex(elementIndex), m_meta(new ModelNodeMetaObject(this))
{
updateValues();
@@ -1269,12 +1269,12 @@ void ModelNodeMetaObject::propertyWritten(int index)
}
}
-DynamicRoleModelNode::DynamicRoleModelNode(QQuickListModel *owner, int uid) : m_owner(owner), m_uid(uid), m_meta(new DynamicRoleModelNodeMetaObject(this))
+DynamicRoleModelNode::DynamicRoleModelNode(QQmlListModel *owner, int uid) : m_owner(owner), m_uid(uid), m_meta(new DynamicRoleModelNodeMetaObject(this))
{
setNodeUpdatesEnabled(true);
}
-DynamicRoleModelNode *DynamicRoleModelNode::create(const QVariantMap &obj, QQuickListModel *owner)
+DynamicRoleModelNode *DynamicRoleModelNode::create(const QVariantMap &obj, QQmlListModel *owner)
{
DynamicRoleModelNode *object = new DynamicRoleModelNode(owner, uidCounter.fetchAndAddOrdered(1));
QVector<int> roles;
@@ -1282,20 +1282,20 @@ DynamicRoleModelNode *DynamicRoleModelNode::create(const QVariantMap &obj, QQuic
return object;
}
-void DynamicRoleModelNode::sync(DynamicRoleModelNode *src, DynamicRoleModelNode *target, QHash<int, QQuickListModel *> *targetModelHash)
+void DynamicRoleModelNode::sync(DynamicRoleModelNode *src, DynamicRoleModelNode *target, QHash<int, QQmlListModel *> *targetModelHash)
{
for (int i=0 ; i < src->m_meta->count() ; ++i) {
const QByteArray &name = src->m_meta->name(i);
QVariant value = src->m_meta->value(i);
- QQuickListModel *srcModel = qobject_cast<QQuickListModel *>(value.value<QObject *>());
- QQuickListModel *targetModel = qobject_cast<QQuickListModel *>(target->m_meta->value(i).value<QObject *>());
+ QQmlListModel *srcModel = qobject_cast<QQmlListModel *>(value.value<QObject *>());
+ QQmlListModel *targetModel = qobject_cast<QQmlListModel *>(target->m_meta->value(i).value<QObject *>());
if (srcModel) {
if (targetModel == 0)
- targetModel = QQuickListModel::createWithOwner(target->m_owner);
+ targetModel = QQmlListModel::createWithOwner(target->m_owner);
- QQuickListModel::sync(srcModel, targetModel, targetModelHash);
+ QQmlListModel::sync(srcModel, targetModel, targetModelHash);
QObject *targetModelObject = targetModel;
value = QVariant::fromValue(targetModelObject);
@@ -1326,7 +1326,7 @@ void DynamicRoleModelNode::updateValues(const QVariantMap &object, QVector<int>
QVariant value = object[key];
if (value.type() == QVariant::List) {
- QQuickListModel *subModel = QQuickListModel::createWithOwner(m_owner);
+ QQmlListModel *subModel = QQmlListModel::createWithOwner(m_owner);
QVariantList subArray = value.toList();
QVariantList::const_iterator subIt = subArray.begin();
@@ -1343,7 +1343,7 @@ void DynamicRoleModelNode::updateValues(const QVariantMap &object, QVector<int>
const QByteArray &keyUtf8 = key.toUtf8();
- QQuickListModel *existingModel = qobject_cast<QQuickListModel *>(m_meta->value(keyUtf8).value<QObject *>());
+ QQmlListModel *existingModel = qobject_cast<QQmlListModel *>(m_meta->value(keyUtf8).value<QObject *>());
if (existingModel)
delete existingModel;
@@ -1362,7 +1362,7 @@ DynamicRoleModelNodeMetaObject::DynamicRoleModelNodeMetaObject(DynamicRoleModelN
DynamicRoleModelNodeMetaObject::~DynamicRoleModelNodeMetaObject()
{
for (int i=0 ; i < count() ; ++i) {
- QQuickListModel *subModel = qobject_cast<QQuickListModel *>(value(i).value<QObject *>());
+ QQmlListModel *subModel = qobject_cast<QQmlListModel *>(value(i).value<QObject *>());
if (subModel)
delete subModel;
}
@@ -1374,7 +1374,7 @@ void DynamicRoleModelNodeMetaObject::propertyWrite(int index)
return;
QVariant v = value(index);
- QQuickListModel *model = qobject_cast<QQuickListModel *>(v.value<QObject *>());
+ QQmlListModel *model = qobject_cast<QQmlListModel *>(v.value<QObject *>());
if (model)
delete model;
}
@@ -1384,11 +1384,11 @@ void DynamicRoleModelNodeMetaObject::propertyWritten(int index)
if (!m_enabled)
return;
- QQuickListModel *parentModel = m_owner->m_owner;
+ QQmlListModel *parentModel = m_owner->m_owner;
QVariant v = value(index);
if (v.type() == QVariant::List) {
- QQuickListModel *subModel = QQuickListModel::createWithOwner(parentModel);
+ QQmlListModel *subModel = QQmlListModel::createWithOwner(parentModel);
QVariantList subArray = v.toList();
QVariantList::const_iterator subIt = subArray.begin();
@@ -1417,14 +1417,14 @@ void DynamicRoleModelNodeMetaObject::propertyWritten(int index)
}
}
-QQuickListModelParser::ListInstruction *QQuickListModelParser::ListModelData::instructions() const
+QQmlListModelParser::ListInstruction *QQmlListModelParser::ListModelData::instructions() const
{
- return (QQuickListModelParser::ListInstruction *)((char *)this + sizeof(ListModelData));
+ return (QQmlListModelParser::ListInstruction *)((char *)this + sizeof(ListModelData));
}
/*!
\qmltype ListModel
- \instantiates QQuickListModel
+ \instantiates QQmlListModel
\inqmlmodule QtQuick 2
\brief Defines a free-form list data source
\ingroup qtquick-models
@@ -1515,7 +1515,7 @@ QQuickListModelParser::ListInstruction *QQuickListModelParser::ListModelData::in
\sa {qml-data-models}{Data Models}, {declarative/threading/threadedlistmodel}{Threaded ListModel example}, QtQml
*/
-QQuickListModel::QQuickListModel(QObject *parent)
+QQmlListModel::QQmlListModel(QObject *parent)
: QAbstractListModel(parent)
{
m_mainThread = true;
@@ -1530,7 +1530,7 @@ QQuickListModel::QQuickListModel(QObject *parent)
m_engine = 0;
}
-QQuickListModel::QQuickListModel(const QQuickListModel *owner, ListModel *data, QV8Engine *eng, QObject *parent)
+QQmlListModel::QQmlListModel(const QQmlListModel *owner, ListModel *data, QV8Engine *eng, QObject *parent)
: QAbstractListModel(parent)
{
m_mainThread = owner->m_mainThread;
@@ -1545,7 +1545,7 @@ QQuickListModel::QQuickListModel(const QQuickListModel *owner, ListModel *data,
m_engine = eng;
}
-QQuickListModel::QQuickListModel(QQuickListModel *orig, QQuickListModelWorkerAgent *agent)
+QQmlListModel::QQmlListModel(QQmlListModel *orig, QQmlListModelWorkerAgent *agent)
: QAbstractListModel(agent)
{
m_mainThread = false;
@@ -1564,7 +1564,7 @@ QQuickListModel::QQuickListModel(QQuickListModel *orig, QQuickListModelWorkerAge
m_engine = 0;
}
-QQuickListModel::~QQuickListModel()
+QQmlListModel::~QQmlListModel()
{
for (int i=0 ; i < m_modelObjects.count() ; ++i)
delete m_modelObjects[i];
@@ -1585,9 +1585,9 @@ QQuickListModel::~QQuickListModel()
m_layout = 0;
}
-QQuickListModel *QQuickListModel::createWithOwner(QQuickListModel *newOwner)
+QQmlListModel *QQmlListModel::createWithOwner(QQmlListModel *newOwner)
{
- QQuickListModel *model = new QQuickListModel;
+ QQmlListModel *model = new QQmlListModel;
model->m_mainThread = newOwner->m_mainThread;
model->m_engine = newOwner->m_engine;
@@ -1602,7 +1602,7 @@ QQuickListModel *QQuickListModel::createWithOwner(QQuickListModel *newOwner)
return model;
}
-QV8Engine *QQuickListModel::engine() const
+QV8Engine *QQmlListModel::engine() const
{
if (m_engine == 0) {
m_engine = QQmlEnginePrivate::getV8Engine(qmlEngine(this));
@@ -1611,7 +1611,7 @@ QV8Engine *QQuickListModel::engine() const
return m_engine;
}
-void QQuickListModel::sync(QQuickListModel *src, QQuickListModel *target, QHash<int, QQuickListModel *> *targetModelHash)
+void QQmlListModel::sync(QQmlListModel *src, QQmlListModel *target, QHash<int, QQmlListModel *> *targetModelHash)
{
Q_ASSERT(src->m_dynamicRoles && target->m_dynamicRoles);
@@ -1672,7 +1672,7 @@ void QQuickListModel::sync(QQuickListModel *src, QQuickListModel *target, QHash<
}
}
-void QQuickListModel::emitItemsChanged(int index, int count, const QVector<int> &roles)
+void QQmlListModel::emitItemsChanged(int index, int count, const QVector<int> &roles)
{
if (count <= 0)
return;
@@ -1685,7 +1685,7 @@ void QQuickListModel::emitItemsChanged(int index, int count, const QVector<int>
}
}
-void QQuickListModel::emitItemsRemoved(int index, int count)
+void QQmlListModel::emitItemsRemoved(int index, int count)
{
if (count <= 0)
return;
@@ -1702,7 +1702,7 @@ void QQuickListModel::emitItemsRemoved(int index, int count)
}
}
-void QQuickListModel::emitItemsInserted(int index, int count)
+void QQmlListModel::emitItemsInserted(int index, int count)
{
if (count <= 0)
return;
@@ -1717,7 +1717,7 @@ void QQuickListModel::emitItemsInserted(int index, int count)
}
}
-void QQuickListModel::emitItemsMoved(int from, int to, int n)
+void QQmlListModel::emitItemsMoved(int from, int to, int n)
{
if (n <= 0)
return;
@@ -1731,33 +1731,33 @@ void QQuickListModel::emitItemsMoved(int from, int to, int n)
}
}
-QQuickListModelWorkerAgent *QQuickListModel::agent()
+QQmlListModelWorkerAgent *QQmlListModel::agent()
{
if (m_agent)
return m_agent;
- m_agent = new QQuickListModelWorkerAgent(this);
+ m_agent = new QQmlListModelWorkerAgent(this);
return m_agent;
}
-QModelIndex QQuickListModel::index(int row, int column, const QModelIndex &parent) const
+QModelIndex QQmlListModel::index(int row, int column, const QModelIndex &parent) const
{
return row >= 0 && row < count() && column == 0 && !parent.isValid()
? createIndex(row, column)
: QModelIndex();
}
-int QQuickListModel::rowCount(const QModelIndex &parent) const
+int QQmlListModel::rowCount(const QModelIndex &parent) const
{
return !parent.isValid() ? count() : 0;
}
-QVariant QQuickListModel::data(const QModelIndex &index, int role) const
+QVariant QQmlListModel::data(const QModelIndex &index, int role) const
{
return data(index.row(), role);
}
-QVariant QQuickListModel::data(int index, int role) const
+QVariant QQmlListModel::data(int index, int role) const
{
QVariant v;
@@ -1772,7 +1772,7 @@ QVariant QQuickListModel::data(int index, int role) const
return v;
}
-QHash<int, QByteArray> QQuickListModel::roleNames() const
+QHash<int, QByteArray> QQmlListModel::roleNames() const
{
QHash<int, QByteArray> roleNames;
@@ -1790,7 +1790,7 @@ QHash<int, QByteArray> QQuickListModel::roleNames() const
}
/*!
- \qmlproperty bool QtQuick2::ListModel::dynamicRoles
+ \qmlproperty bool QtQml2::ListModel::dynamicRoles
By default, the type of a role is fixed the first time
the role is used. For example, if you create a role called
@@ -1815,7 +1815,7 @@ QHash<int, QByteArray> QQuickListModel::roleNames() const
Due to the performance cost of using dynamic roles,
they are disabled by default.
*/
-void QQuickListModel::setDynamicRoles(bool enableDynamicRoles)
+void QQmlListModel::setDynamicRoles(bool enableDynamicRoles)
{
if (m_mainThread && m_agent == 0) {
if (enableDynamicRoles) {
@@ -1836,10 +1836,10 @@ void QQuickListModel::setDynamicRoles(bool enableDynamicRoles)
}
/*!
- \qmlproperty int QtQuick2::ListModel::count
+ \qmlproperty int QtQml2::ListModel::count
The number of data entries in the model.
*/
-int QQuickListModel::count() const
+int QQmlListModel::count() const
{
int count;
@@ -1853,13 +1853,13 @@ int QQuickListModel::count() const
}
/*!
- \qmlmethod QtQuick2::ListModel::clear()
+ \qmlmethod QtQml2::ListModel::clear()
Deletes all content from the model.
\sa append(), remove()
*/
-void QQuickListModel::clear()
+void QQmlListModel::clear()
{
int cleared = count();
@@ -1875,13 +1875,13 @@ void QQuickListModel::clear()
}
/*!
- \qmlmethod QtQuick2::ListModel::remove(int index, int count = 1)
+ \qmlmethod QtQml2::ListModel::remove(int index, int count = 1)
Deletes the content at \a index from the model.
\sa clear()
*/
-void QQuickListModel::remove(QQmlV8Function *args)
+void QQmlListModel::remove(QQmlV8Function *args)
{
int argLength = args->Length();
@@ -1909,7 +1909,7 @@ void QQuickListModel::remove(QQmlV8Function *args)
}
/*!
- \qmlmethod QtQuick2::ListModel::insert(int index, jsobject dict)
+ \qmlmethod QtQml2::ListModel::insert(int index, jsobject dict)
Adds a new item to the list model at position \a index, with the
values in \a dict.
@@ -1924,7 +1924,7 @@ void QQuickListModel::remove(QQmlV8Function *args)
\sa set(), append()
*/
-void QQuickListModel::insert(QQmlV8Function *args)
+void QQmlListModel::insert(QQmlV8Function *args)
{
if (args->Length() == 2) {
@@ -1970,7 +1970,7 @@ void QQuickListModel::insert(QQmlV8Function *args)
}
/*!
- \qmlmethod QtQuick2::ListModel::move(int from, int to, int n)
+ \qmlmethod QtQml2::ListModel::move(int from, int to, int n)
Moves \a n items \a from one position \a to another.
@@ -1983,7 +1983,7 @@ void QQuickListModel::insert(QQmlV8Function *args)
\sa append()
*/
-void QQuickListModel::move(int from, int to, int n)
+void QQmlListModel::move(int from, int to, int n)
{
if (n==0 || from==to)
return;
@@ -2023,7 +2023,7 @@ void QQuickListModel::move(int from, int to, int n)
}
/*!
- \qmlmethod QtQuick2::ListModel::append(jsobject dict)
+ \qmlmethod QtQml2::ListModel::append(jsobject dict)
Adds a new item to the end of the list model, with the
values in \a dict.
@@ -2034,7 +2034,7 @@ void QQuickListModel::move(int from, int to, int n)
\sa set(), remove()
*/
-void QQuickListModel::append(QQmlV8Function *args)
+void QQmlListModel::append(QQmlV8Function *args)
{
if (args->Length() == 1) {
v8::Handle<v8::Value> arg = (*args)[0];
@@ -2077,7 +2077,7 @@ void QQuickListModel::append(QQmlV8Function *args)
}
/*!
- \qmlmethod object QtQuick2::ListModel::get(int index)
+ \qmlmethod object QtQml2::ListModel::get(int index)
Returns the item at \a index in the list model. This allows the item
data to be accessed or modified from JavaScript:
@@ -2107,7 +2107,7 @@ void QQuickListModel::append(QQmlV8Function *args)
\sa append()
*/
-QQmlV8Handle QQuickListModel::get(int index) const
+QQmlV8Handle QQmlListModel::get(int index) const
{
v8::Handle<v8::Value> result = v8::Undefined();
@@ -2118,7 +2118,7 @@ QQmlV8Handle QQuickListModel::get(int index) const
DynamicRoleModelNode *object = m_modelObjects[index];
result = v8engine->newQObject(object);
} else {
- ModelObject *object = m_listModel->getOrCreateModelObject(const_cast<QQuickListModel *>(this), index);
+ ModelObject *object = m_listModel->getOrCreateModelObject(const_cast<QQmlListModel *>(this), index);
result = v8engine->newQObject(object);
}
}
@@ -2127,7 +2127,7 @@ QQmlV8Handle QQuickListModel::get(int index) const
}
/*!
- \qmlmethod QtQuick2::ListModel::set(int index, jsobject dict)
+ \qmlmethod QtQml2::ListModel::set(int index, jsobject dict)
Changes the item at \a index in the list model with the
values in \a dict. Properties not appearing in \a dict
@@ -2142,7 +2142,7 @@ QQmlV8Handle QQuickListModel::get(int index) const
\sa append()
*/
-void QQuickListModel::set(int index, const QQmlV8Handle &handle)
+void QQmlListModel::set(int index, const QQmlV8Handle &handle)
{
v8::Handle<v8::Value> valuemap = handle.toHandle();
@@ -2182,7 +2182,7 @@ void QQuickListModel::set(int index, const QQmlV8Handle &handle)
}
/*!
- \qmlmethod QtQuick2::ListModel::setProperty(int index, string property, variant value)
+ \qmlmethod QtQml2::ListModel::setProperty(int index, string property, variant value)
Changes the \a property of the item at \a index in the list model to \a value.
@@ -2194,7 +2194,7 @@ void QQuickListModel::set(int index, const QQmlV8Handle &handle)
\sa append()
*/
-void QQuickListModel::setProperty(int index, const QString& property, const QVariant& value)
+void QQmlListModel::setProperty(int index, const QString& property, const QVariant& value)
{
if (count() == 0 || index >= count() || index < 0) {
qmlInfo(this) << tr("set: index %1 out of range").arg(index);
@@ -2225,20 +2225,20 @@ void QQuickListModel::setProperty(int index, const QString& property, const QVar
}
/*!
- \qmlmethod QtQuick2::ListModel::sync()
+ \qmlmethod QtQml2::ListModel::sync()
Writes any unsaved changes to the list model after it has been modified
from a worker script.
*/
-void QQuickListModel::sync()
+void QQmlListModel::sync()
{
// This is just a dummy method to make it look like sync() exists in
- // ListModel (and not just QQuickListModelWorkerAgent) and to let
+ // ListModel (and not just QQmlListModelWorkerAgent) and to let
// us document sync().
qmlInfo(this) << "List sync() can only be called from a WorkerScript";
}
-bool QQuickListModelParser::compileProperty(const QQmlCustomParserProperty &prop, QList<ListInstruction> &instr, QByteArray &data)
+bool QQmlListModelParser::compileProperty(const QQmlCustomParserProperty &prop, QList<ListInstruction> &instr, QByteArray &data)
{
QList<QVariant> values = prop.assignedValues();
for(int ii = 0; ii < values.count(); ++ii) {
@@ -2250,8 +2250,8 @@ bool QQuickListModelParser::compileProperty(const QQmlCustomParserProperty &prop
if (node.name() != listElementTypeName) {
const QMetaObject *mo = resolveType(node.name());
- if (mo != &QQuickListElement::staticMetaObject) {
- error(node, QQuickListModel::tr("ListElement: cannot contain nested elements"));
+ if (mo != &QQmlListElement::staticMetaObject) {
+ error(node, QQmlListModel::tr("ListElement: cannot contain nested elements"));
return false;
}
listElementTypeName = node.name(); // cache right name for next time
@@ -2268,11 +2268,11 @@ bool QQuickListModelParser::compileProperty(const QQmlCustomParserProperty &prop
for(int jj = 0; jj < props.count(); ++jj) {
const QQmlCustomParserProperty &nodeProp = props.at(jj);
if (nodeProp.name().isEmpty()) {
- error(nodeProp, QQuickListModel::tr("ListElement: cannot contain nested elements"));
+ error(nodeProp, QQmlListModel::tr("ListElement: cannot contain nested elements"));
return false;
}
if (nodeProp.name() == QStringLiteral("id")) {
- error(nodeProp, QQuickListModel::tr("ListElement: cannot use reserved \"id\" property"));
+ error(nodeProp, QQmlListModel::tr("ListElement: cannot use reserved \"id\" property"));
return false;
}
@@ -2331,14 +2331,14 @@ bool QQuickListModelParser::compileProperty(const QQmlCustomParserProperty &prop
if (callExpr->arguments && !callExpr->arguments->next)
literal = AST::cast<AST::StringLiteral *>(callExpr->arguments->expression);
if (!literal) {
- error(prop, QQuickListModel::tr("ListElement: improperly specified %1").arg(idExpr->name.toString()));
+ error(prop, QQmlListModel::tr("ListElement: improperly specified %1").arg(idExpr->name.toString()));
return false;
}
} else if (idExpr->name == QLatin1String("QT_TRANSLATE_NOOP")) {
if (callExpr->arguments && callExpr->arguments->next && !callExpr->arguments->next->next)
literal = AST::cast<AST::StringLiteral *>(callExpr->arguments->next->expression);
if (!literal) {
- error(prop, QQuickListModel::tr("ListElement: improperly specified QT_TRANSLATE_NOOP"));
+ error(prop, QQmlListModel::tr("ListElement: improperly specified QT_TRANSLATE_NOOP"));
return false;
}
}
@@ -2349,7 +2349,7 @@ bool QQuickListModelParser::compileProperty(const QQmlCustomParserProperty &prop
d[0] = char(QQmlScript::Variant::String);
d += literal->value.toUtf8();
} else {
- error(prop, QQuickListModel::tr("ListElement: cannot use script for property value"));
+ error(prop, QQmlListModel::tr("ListElement: cannot use script for property value"));
return false;
}
} else {
@@ -2371,7 +2371,7 @@ bool QQuickListModelParser::compileProperty(const QQmlCustomParserProperty &prop
return true;
}
-QByteArray QQuickListModelParser::compile(const QList<QQmlCustomParserProperty> &customProps)
+QByteArray QQmlListModelParser::compile(const QList<QQmlCustomParserProperty> &customProps)
{
QList<ListInstruction> instr;
QByteArray data;
@@ -2380,7 +2380,7 @@ QByteArray QQuickListModelParser::compile(const QList<QQmlCustomParserProperty>
for(int ii = 0; ii < customProps.count(); ++ii) {
const QQmlCustomParserProperty &prop = customProps.at(ii);
if(!prop.name().isEmpty()) { // isn't default property
- error(prop, QQuickListModel::tr("ListModel: undefined property '%1'").arg(prop.name()));
+ error(prop, QQmlListModel::tr("ListModel: undefined property '%1'").arg(prop.name()));
return QByteArray();
}
@@ -2407,9 +2407,9 @@ QByteArray QQuickListModelParser::compile(const QList<QQmlCustomParserProperty>
return rv;
}
-void QQuickListModelParser::setCustomData(QObject *obj, const QByteArray &d)
+void QQmlListModelParser::setCustomData(QObject *obj, const QByteArray &d)
{
- QQuickListModel *rv = static_cast<QQuickListModel *>(obj);
+ QQmlListModel *rv = static_cast<QQmlListModel *>(obj);
QV8Engine *engine = QQmlEnginePrivate::getV8Engine(qmlEngine(rv));
rv->m_engine = engine;
@@ -2508,7 +2508,7 @@ void QQuickListModelParser::setCustomData(QObject *obj, const QByteArray &d)
qmlInfo(obj) << "All ListElement declarations are empty, no roles can be created unless dynamicRoles is set.";
}
-bool QQuickListModelParser::definesEmptyList(const QString &s)
+bool QQmlListModelParser::definesEmptyList(const QString &s)
{
if (s.startsWith(QLatin1Char('[')) && s.endsWith(QLatin1Char(']'))) {
for (int i=1; i<s.length()-1; i++) {
@@ -2523,7 +2523,7 @@ bool QQuickListModelParser::definesEmptyList(const QString &s)
/*!
\qmltype ListElement
- \instantiates QQuickListElement
+ \instantiates QQmlListElement
\inqmlmodule QtQuick 2
\brief Defines a data item in a ListModel
\ingroup qtquick-models
diff --git a/src/qml/qml/qquicklistmodel_p.h b/src/qml/qml/qqmllistmodel_p.h
index 8649238b80..04a6c230f6 100644
--- a/src/qml/qml/qquicklistmodel_p.h
+++ b/src/qml/qml/qqmllistmodel_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QQUICKLISTMODEL_H
-#define QQUICKLISTMODEL_H
+#ifndef QQMLLISTMODEL_H
+#define QQMLLISTMODEL_H
#include <qqml.h>
#include <private/qqmlcustomparser_p.h>
@@ -60,19 +60,19 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-class QQuickListModelWorkerAgent;
+class QQmlListModelWorkerAgent;
class ListModel;
class ListLayout;
-class Q_QML_PRIVATE_EXPORT QQuickListModel : public QAbstractListModel
+class Q_QML_PRIVATE_EXPORT QQmlListModel : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(int count READ count NOTIFY countChanged)
Q_PROPERTY(bool dynamicRoles READ dynamicRoles WRITE setDynamicRoles)
public:
- QQuickListModel(QObject *parent=0);
- ~QQuickListModel();
+ QQmlListModel(QObject *parent=0);
+ ~QQmlListModel();
QModelIndex index(int row, int column, const QModelIndex &parent) const;
int rowCount(const QModelIndex &parent) const;
@@ -92,7 +92,7 @@ public:
Q_INVOKABLE void move(int from, int to, int count);
Q_INVOKABLE void sync();
- QQuickListModelWorkerAgent *agent();
+ QQmlListModelWorkerAgent *agent();
bool dynamicRoles() const { return m_dynamicRoles; }
void setDynamicRoles(bool enableDynamicRoles);
@@ -101,8 +101,8 @@ Q_SIGNALS:
void countChanged();
private:
- friend class QQuickListModelParser;
- friend class QQuickListModelWorkerAgent;
+ friend class QQmlListModelParser;
+ friend class QQmlListModelWorkerAgent;
friend class ModelObject;
friend class ModelNodeMetaObject;
friend class ListModel;
@@ -111,14 +111,14 @@ private:
friend class DynamicRoleModelNodeMetaObject;
// Constructs a flat list model for a worker agent
- QQuickListModel(QQuickListModel *orig, QQuickListModelWorkerAgent *agent);
- QQuickListModel(const QQuickListModel *owner, ListModel *data, QV8Engine *eng, QObject *parent=0);
+ QQmlListModel(QQmlListModel *orig, QQmlListModelWorkerAgent *agent);
+ QQmlListModel(const QQmlListModel *owner, ListModel *data, QV8Engine *eng, QObject *parent=0);
QV8Engine *engine() const;
inline bool canMove(int from, int to, int n) const { return !(from+n > count() || to+n > count() || from < 0 || to < 0 || n < 0); }
- QQuickListModelWorkerAgent *m_agent;
+ QQmlListModelWorkerAgent *m_agent;
mutable QV8Engine *m_engine;
bool m_mainThread;
bool m_primary;
@@ -142,8 +142,8 @@ private:
int getUid() const { return m_uid; }
- static void sync(QQuickListModel *src, QQuickListModel *target, QHash<int, QQuickListModel *> *targetModelHash);
- static QQuickListModel *createWithOwner(QQuickListModel *newOwner);
+ static void sync(QQmlListModel *src, QQmlListModel *target, QHash<int, QQmlListModel *> *targetModelHash);
+ static QQmlListModel *createWithOwner(QQmlListModel *newOwner);
void emitItemsChanged(int index, int count, const QVector<int> &roles);
void emitItemsRemoved(int index, int count);
@@ -152,15 +152,15 @@ private:
};
// ### FIXME
-class QQuickListElement : public QObject
+class QQmlListElement : public QObject
{
Q_OBJECT
};
-class QQuickListModelParser : public QQmlCustomParser
+class QQmlListModelParser : public QQmlCustomParser
{
public:
- QQuickListModelParser() : QQmlCustomParser(QQmlCustomParser::AcceptsSignalHandlers) {}
+ QQmlListModelParser() : QQmlCustomParser(QQmlCustomParser::AcceptsSignalHandlers) {}
QByteArray compile(const QList<QQmlCustomParserProperty> &);
void setCustomData(QObject *, const QByteArray &);
@@ -194,9 +194,9 @@ private:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickListModel)
-QML_DECLARE_TYPE(QQuickListElement)
+QML_DECLARE_TYPE(QQmlListModel)
+QML_DECLARE_TYPE(QQmlListElement)
QT_END_HEADER
-#endif // QQUICKLISTMODEL_H
+#endif // QQMLLISTMODEL_H
diff --git a/src/qml/qml/qquicklistmodel_p_p.h b/src/qml/qml/qqmllistmodel_p_p.h
index ff312f98e5..d48edec0bf 100644
--- a/src/qml/qml/qquicklistmodel_p_p.h
+++ b/src/qml/qml/qqmllistmodel_p_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QQUICKLISTMODEL_P_P_H
-#define QQUICKLISTMODEL_P_P_H
+#ifndef QQMLLISTMODEL_P_P_H
+#define QQMLLISTMODEL_P_P_H
//
// W A R N I N G
@@ -53,7 +53,7 @@
// We mean it.
//
-#include "qquicklistmodel_p.h"
+#include "qqmllistmodel_p.h"
#include <private/qqmlengine_p.h>
#include "qqmlopenmetaobject_p.h"
#include <qqml.h>
@@ -85,9 +85,9 @@ class DynamicRoleModelNode : public QObject
{
Q_OBJECT
public:
- DynamicRoleModelNode(QQuickListModel *owner, int uid);
+ DynamicRoleModelNode(QQmlListModel *owner, int uid);
- static DynamicRoleModelNode *create(const QVariantMap &obj, QQuickListModel *owner);
+ static DynamicRoleModelNode *create(const QVariantMap &obj, QQmlListModel *owner);
void updateValues(const QVariantMap &object, QVector<int> &roles);
@@ -111,10 +111,10 @@ public:
return m_uid;
}
- static void sync(DynamicRoleModelNode *src, DynamicRoleModelNode *target, QHash<int, QQuickListModel *> *targetModelHash);
+ static void sync(DynamicRoleModelNode *src, DynamicRoleModelNode *target, QHash<int, QQmlListModel *> *targetModelHash);
private:
- QQuickListModel *m_owner;
+ QQmlListModel *m_owner;
int m_uid;
DynamicRoleModelNodeMetaObject *m_meta;
@@ -143,7 +143,7 @@ class ModelObject : public QObject
{
Q_OBJECT
public:
- ModelObject(QQuickListModel *model, int elementIndex);
+ ModelObject(QQmlListModel *model, int elementIndex);
void setValue(const QByteArray &name, const QVariant &val, bool force)
{
@@ -164,7 +164,7 @@ public:
void updateValues();
void updateValues(const QVector<int> &roles);
- QQuickListModel *m_model;
+ QQmlListModel *m_model;
int m_elementIndex;
private:
@@ -273,7 +273,7 @@ private:
void clearProperty(const ListLayout::Role &role);
- QVariant getProperty(const ListLayout::Role &role, const QQuickListModel *owner, QV8Engine *eng);
+ QVariant getProperty(const ListLayout::Role &role, const QQmlListModel *owner, QV8Engine *eng);
ListModel *getListProperty(const ListLayout::Role &role);
QString *getStringProperty(const ListLayout::Role &role);
QObject *getQObjectProperty(const ListLayout::Role &role);
@@ -298,7 +298,7 @@ class ListModel
{
public:
- ListModel(ListLayout *layout, QQuickListModel *modelCache, int uid);
+ ListModel(ListLayout *layout, QQmlListModel *modelCache, int uid);
~ListModel() {}
void destroy();
@@ -306,7 +306,7 @@ public:
int setOrCreateProperty(int elementIndex, const QString &key, const QVariant &data);
int setExistingProperty(int uid, const QString &key, v8::Handle<v8::Value> data, QV8Engine *eng);
- QVariant getProperty(int elementIndex, int roleIndex, const QQuickListModel *owner, QV8Engine *eng);
+ QVariant getProperty(int elementIndex, int roleIndex, const QQmlListModel *owner, QV8Engine *eng);
ListModel *getListProperty(int elementIndex, const ListLayout::Role &role);
int roleCount() const
@@ -347,14 +347,14 @@ public:
static void sync(ListModel *src, ListModel *target, QHash<int, ListModel *> *srcModelHash);
- ModelObject *getOrCreateModelObject(QQuickListModel *model, int elementIndex);
+ ModelObject *getOrCreateModelObject(QQmlListModel *model, int elementIndex);
private:
QPODVector<ListElement *, 4> elements;
ListLayout *m_layout;
int m_uid;
- QQuickListModel *m_modelCache;
+ QQmlListModel *m_modelCache;
struct ElementSync
{
@@ -369,7 +369,7 @@ private:
void updateCacheIndices();
friend class ListElement;
- friend class QQuickListModelWorkerAgent;
+ friend class QQmlListModelWorkerAgent;
};
QT_END_NAMESPACE
diff --git a/src/qml/qml/qquicklistmodelworkeragent.cpp b/src/qml/qml/qqmllistmodelworkeragent.cpp
index e0ab882b92..9554e6d1e5 100644
--- a/src/qml/qml/qquicklistmodelworkeragent.cpp
+++ b/src/qml/qml/qqmllistmodelworkeragent.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#include "qquicklistmodelworkeragent_p.h"
-#include "qquicklistmodel_p_p.h"
+#include "qqmllistmodelworkeragent_p.h"
+#include "qqmllistmodel_p_p.h"
#include <private/qqmldata_p.h>
#include <private/qqmlengine_p.h>
#include <qqmlinfo.h>
@@ -53,7 +53,7 @@
QT_BEGIN_NAMESPACE
-void QQuickListModelWorkerAgent::Data::clearChange(int uid)
+void QQmlListModelWorkerAgent::Data::clearChange(int uid)
{
for (int i=0 ; i < changes.count() ; ++i) {
if (changes[i].modelUid == uid) {
@@ -63,53 +63,53 @@ void QQuickListModelWorkerAgent::Data::clearChange(int uid)
}
}
-void QQuickListModelWorkerAgent::Data::insertChange(int uid, int index, int count)
+void QQmlListModelWorkerAgent::Data::insertChange(int uid, int index, int count)
{
Change c = { uid, Change::Inserted, index, count, 0, QVector<int>() };
changes << c;
}
-void QQuickListModelWorkerAgent::Data::removeChange(int uid, int index, int count)
+void QQmlListModelWorkerAgent::Data::removeChange(int uid, int index, int count)
{
Change c = { uid, Change::Removed, index, count, 0, QVector<int>() };
changes << c;
}
-void QQuickListModelWorkerAgent::Data::moveChange(int uid, int index, int count, int to)
+void QQmlListModelWorkerAgent::Data::moveChange(int uid, int index, int count, int to)
{
Change c = { uid, Change::Moved, index, count, to, QVector<int>() };
changes << c;
}
-void QQuickListModelWorkerAgent::Data::changedChange(int uid, int index, int count, const QVector<int> &roles)
+void QQmlListModelWorkerAgent::Data::changedChange(int uid, int index, int count, const QVector<int> &roles)
{
Change c = { uid, Change::Changed, index, count, 0, roles };
changes << c;
}
-QQuickListModelWorkerAgent::QQuickListModelWorkerAgent(QQuickListModel *model)
-: m_ref(1), m_orig(model), m_copy(new QQuickListModel(model, this))
+QQmlListModelWorkerAgent::QQmlListModelWorkerAgent(QQmlListModel *model)
+: m_ref(1), m_orig(model), m_copy(new QQmlListModel(model, this))
{
}
-QQuickListModelWorkerAgent::~QQuickListModelWorkerAgent()
+QQmlListModelWorkerAgent::~QQmlListModelWorkerAgent()
{
mutex.lock();
syncDone.wakeAll();
mutex.unlock();
}
-void QQuickListModelWorkerAgent::setV8Engine(QV8Engine *eng)
+void QQmlListModelWorkerAgent::setV8Engine(QV8Engine *eng)
{
m_copy->m_engine = eng;
}
-void QQuickListModelWorkerAgent::addref()
+void QQmlListModelWorkerAgent::addref()
{
m_ref.ref();
}
-void QQuickListModelWorkerAgent::release()
+void QQmlListModelWorkerAgent::release()
{
bool del = !m_ref.deref();
@@ -117,57 +117,57 @@ void QQuickListModelWorkerAgent::release()
deleteLater();
}
-void QQuickListModelWorkerAgent::modelDestroyed()
+void QQmlListModelWorkerAgent::modelDestroyed()
{
m_orig = 0;
}
-int QQuickListModelWorkerAgent::count() const
+int QQmlListModelWorkerAgent::count() const
{
return m_copy->count();
}
-void QQuickListModelWorkerAgent::clear()
+void QQmlListModelWorkerAgent::clear()
{
m_copy->clear();
}
-void QQuickListModelWorkerAgent::remove(QQmlV8Function *args)
+void QQmlListModelWorkerAgent::remove(QQmlV8Function *args)
{
m_copy->remove(args);
}
-void QQuickListModelWorkerAgent::append(QQmlV8Function *args)
+void QQmlListModelWorkerAgent::append(QQmlV8Function *args)
{
m_copy->append(args);
}
-void QQuickListModelWorkerAgent::insert(QQmlV8Function *args)
+void QQmlListModelWorkerAgent::insert(QQmlV8Function *args)
{
m_copy->insert(args);
}
-QQmlV8Handle QQuickListModelWorkerAgent::get(int index) const
+QQmlV8Handle QQmlListModelWorkerAgent::get(int index) const
{
return m_copy->get(index);
}
-void QQuickListModelWorkerAgent::set(int index, const QQmlV8Handle &value)
+void QQmlListModelWorkerAgent::set(int index, const QQmlV8Handle &value)
{
m_copy->set(index, value);
}
-void QQuickListModelWorkerAgent::setProperty(int index, const QString& property, const QVariant& value)
+void QQmlListModelWorkerAgent::setProperty(int index, const QString& property, const QVariant& value)
{
m_copy->setProperty(index, property, value);
}
-void QQuickListModelWorkerAgent::move(int from, int to, int count)
+void QQmlListModelWorkerAgent::move(int from, int to, int count)
{
m_copy->move(from, to, count);
}
-void QQuickListModelWorkerAgent::sync()
+void QQmlListModelWorkerAgent::sync()
{
Sync *s = new Sync;
s->data = data;
@@ -180,7 +180,7 @@ void QQuickListModelWorkerAgent::sync()
mutex.unlock();
}
-bool QQuickListModelWorkerAgent::event(QEvent *e)
+bool QQmlListModelWorkerAgent::event(QEvent *e)
{
if (e->type() == QEvent::User) {
bool cc = false;
@@ -191,19 +191,19 @@ bool QQuickListModelWorkerAgent::event(QEvent *e)
cc = m_orig->count() != s->list->count();
- QHash<int, QQuickListModel *> targetModelDynamicHash;
+ QHash<int, QQmlListModel *> targetModelDynamicHash;
QHash<int, ListModel *> targetModelStaticHash;
Q_ASSERT(m_orig->m_dynamicRoles == s->list->m_dynamicRoles);
if (m_orig->m_dynamicRoles)
- QQuickListModel::sync(s->list, m_orig, &targetModelDynamicHash);
+ QQmlListModel::sync(s->list, m_orig, &targetModelDynamicHash);
else
ListModel::sync(s->list->m_listModel, m_orig->m_listModel, &targetModelStaticHash);
for (int ii = 0; ii < changes.count(); ++ii) {
const Change &change = changes.at(ii);
- QQuickListModel *model = 0;
+ QQmlListModel *model = 0;
if (m_orig->m_dynamicRoles) {
model = targetModelDynamicHash.value(change.modelUid);
} else {
diff --git a/src/qml/qml/qquicklistmodelworkeragent_p.h b/src/qml/qml/qqmllistmodelworkeragent_p.h
index 7cff9be8f4..9471d6663f 100644
--- a/src/qml/qml/qquicklistmodelworkeragent_p.h
+++ b/src/qml/qml/qqmllistmodelworkeragent_p.h
@@ -65,16 +65,16 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-class QQuickListModel;
+class QQmlListModel;
-class QQuickListModelWorkerAgent : public QObject
+class QQmlListModelWorkerAgent : public QObject
{
Q_OBJECT
Q_PROPERTY(int count READ count)
public:
- QQuickListModelWorkerAgent(QQuickListModel *);
- ~QQuickListModelWorkerAgent();
+ QQmlListModelWorkerAgent(QQmlListModel *);
+ ~QQmlListModelWorkerAgent();
void setV8Engine(QV8Engine *eng);
void addref();
@@ -96,7 +96,7 @@ public:
{
VariantRef() : a(0) {}
VariantRef(const VariantRef &r) : a(r.a) { if (a) a->addref(); }
- VariantRef(QQuickListModelWorkerAgent *_a) : a(_a) { if (a) a->addref(); }
+ VariantRef(QQmlListModelWorkerAgent *_a) : a(_a) { if (a) a->addref(); }
~VariantRef() { if (a) a->release(); }
VariantRef &operator=(const VariantRef &o) {
@@ -105,7 +105,7 @@ public:
return *this;
}
- QQuickListModelWorkerAgent *a;
+ QQmlListModelWorkerAgent *a;
};
void modelDestroyed();
protected:
@@ -113,7 +113,7 @@ protected:
private:
friend class QQuickWorkerScriptEnginePrivate;
- friend class QQuickListModel;
+ friend class QQmlListModel;
struct Change
{
@@ -140,19 +140,19 @@ private:
struct Sync : public QEvent {
Sync() : QEvent(QEvent::User) {}
Data data;
- QQuickListModel *list;
+ QQmlListModel *list;
};
QAtomicInt m_ref;
- QQuickListModel *m_orig;
- QQuickListModel *m_copy;
+ QQmlListModel *m_orig;
+ QQmlListModel *m_copy;
QMutex mutex;
QWaitCondition syncDone;
};
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QQuickListModelWorkerAgent::VariantRef)
+Q_DECLARE_METATYPE(QQmlListModelWorkerAgent::VariantRef)
QT_END_HEADER
diff --git a/src/qml/qml/qquickworkerscript.cpp b/src/qml/qml/qquickworkerscript.cpp
index f7559f1d36..b9b027f6ad 100644
--- a/src/qml/qml/qquickworkerscript.cpp
+++ b/src/qml/qml/qquickworkerscript.cpp
@@ -40,8 +40,8 @@
****************************************************************************/
#include "qquickworkerscript_p.h"
-#include "qquicklistmodel_p.h"
-#include "qquicklistmodelworkeragent_p.h"
+#include "qqmllistmodel_p.h"
+#include "qqmllistmodelworkeragent_p.h"
#include "qqmlengine_p.h"
#include "qqmlexpression_p.h"
@@ -484,7 +484,7 @@ QQuickWorkerScriptEngine::~QQuickWorkerScriptEngine()
//We have to force to cleanup the main thread's event queue here
//to make sure the main GUI release all pending locks/wait conditions which
- //some worker script/agent are waiting for (QQuickListModelWorkerAgent::sync() for example).
+ //some worker script/agent are waiting for (QQmlListModelWorkerAgent::sync() for example).
while (!isFinished()) {
// We can't simply wait here, because the worker thread will not terminate
// until the main thread processes the last data event it generates
diff --git a/src/qml/qml/v8/qv8worker.cpp b/src/qml/qml/v8/qv8worker.cpp
index bf3379b312..9556e146ef 100644
--- a/src/qml/qml/v8/qv8worker.cpp
+++ b/src/qml/qml/v8/qv8worker.cpp
@@ -41,8 +41,8 @@
#include "qv8worker_p.h"
-#include <private/qquicklistmodel_p.h>
-#include <private/qquicklistmodelworkeragent_p.h>
+#include <private/qqmllistmodel_p.h>
+#include <private/qqmllistmodelworkeragent_p.h>
QT_BEGIN_NAMESPACE
@@ -242,9 +242,9 @@ void QV8Worker::serialize(QByteArray &data, v8::Handle<v8::Value> v, QV8Engine *
} else if (engine->isQObject(v)) {
// XXX TODO: Generalize passing objects between the main thread and worker scripts so
// that others can trivially plug in their elements.
- QQuickListModel *lm = qobject_cast<QQuickListModel *>(engine->toQObject(v));
+ QQmlListModel *lm = qobject_cast<QQmlListModel *>(engine->toQObject(v));
if (lm && lm->agent()) {
- QQuickListModelWorkerAgent *agent = lm->agent();
+ QQmlListModelWorkerAgent *agent = lm->agent();
agent->addref();
push(data, valueheader(WorkerListModel));
push(data, (void *)agent);
@@ -347,10 +347,10 @@ v8::Handle<v8::Value> QV8Worker::deserialize(const char *&data, QV8Engine *engin
case WorkerListModel:
{
void *ptr = popPtr(data);
- QQuickListModelWorkerAgent *agent = (QQuickListModelWorkerAgent *)ptr;
+ QQmlListModelWorkerAgent *agent = (QQmlListModelWorkerAgent *)ptr;
v8::Handle<v8::Value> rv = engine->newQObject(agent);
if (rv->IsObject()) {
- QQuickListModelWorkerAgent::VariantRef ref(agent);
+ QQmlListModelWorkerAgent::VariantRef ref(agent);
QVariant var = qVariantFromValue(ref);
rv->ToObject()->SetHiddenValue(v8::String::New("qml::ref"), engine->fromVariant(var));
}