aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-05-08 16:22:39 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2013-05-08 19:57:01 +0200
commit995d65f3f4f348757363ba2a3a3c3444aa281b4e (patch)
treecae5c176847609abc33f51c065aa38b38cd6b9b9 /src/qml/types
parent2b0d3bf812273e762e7aa27a58909ade59590c0f (diff)
Cleanup v8 dependencies from QQmlV8Function
... and rename it to QQmlV4Function Change-Id: Iad72347babf62691e26306877d4f229fda127eb7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/types')
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp46
-rw-r--r--src/qml/types/qqmldelegatemodel_p.h18
-rw-r--r--src/qml/types/qqmldelegatemodel_p_p.h2
-rw-r--r--src/qml/types/qqmllistmodel.cpp16
-rw-r--r--src/qml/types/qqmllistmodel_p.h6
-rw-r--r--src/qml/types/qqmllistmodelworkeragent.cpp6
-rw-r--r--src/qml/types/qqmllistmodelworkeragent_p.h6
-rw-r--r--src/qml/types/qquickworkerscript.cpp4
-rw-r--r--src/qml/types/qquickworkerscript_p.h4
9 files changed, 54 insertions, 54 deletions
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index 4d0f17489c..6242af8fcd 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -2397,7 +2397,7 @@ bool QQmlDelegateModelGroupPrivate::parseIndex(
items that are later replaced by actual data.
*/
-void QQmlDelegateModelGroup::insert(QQmlV8Function *args)
+void QQmlDelegateModelGroup::insert(QQmlV4Function *args)
{
Q_D(QQmlDelegateModelGroup);
QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model);
@@ -2405,7 +2405,7 @@ void QQmlDelegateModelGroup::insert(QQmlV8Function *args)
int index = model->m_compositor.count(d->group);
Compositor::Group group = d->group;
- if (args->Length() == 0)
+ if (args->length() == 0)
return;
int i = 0;
@@ -2415,7 +2415,7 @@ void QQmlDelegateModelGroup::insert(QQmlV8Function *args)
qmlInfo(this) << tr("insert: index out of range");
return;
}
- if (++i == args->Length())
+ if (++i == args->length())
return;
v = (*args)[i];
}
@@ -2425,7 +2425,7 @@ void QQmlDelegateModelGroup::insert(QQmlV8Function *args)
: model->m_compositor.end();
int groups = 1 << d->group;
- if (++i < args->Length())
+ if (++i < args->length())
groups |= model->m_cacheMetaType->parseGroups((*args)[i]);
if (v->IsArray()) {
@@ -2453,13 +2453,13 @@ void QQmlDelegateModelGroup::insert(QQmlV8Function *args)
group remain instantiated when not referenced by any view.
*/
-void QQmlDelegateModelGroup::create(QQmlV8Function *args)
+void QQmlDelegateModelGroup::create(QQmlV4Function *args)
{
Q_D(QQmlDelegateModelGroup);
if (!d->model)
return;
- if (args->Length() == 0)
+ if (args->length() == 0)
return;
QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model);
@@ -2472,11 +2472,11 @@ void QQmlDelegateModelGroup::create(QQmlV8Function *args)
if (d->parseIndex(v, &index, &group))
++i;
- if (i < args->Length() && index >= 0 && index <= model->m_compositor.count(group)) {
+ if (i < args->length() && index >= 0 && index <= model->m_compositor.count(group)) {
v = (*args)[i];
if (v->IsObject()) {
int groups = 1 << d->group;
- if (++i < args->Length())
+ if (++i < args->length())
groups |= model->m_cacheMetaType->parseGroups((*args)[i]);
Compositor::insert_iterator before = index < model->m_compositor.count(group)
@@ -2505,7 +2505,7 @@ void QQmlDelegateModelGroup::create(QQmlV8Function *args)
model->m_cache.at(it.cacheIndex)->releaseObject();
}
- args->returnValue(args->engine()->newQObject(object));
+ args->setReturnValue(args->engine()->newQObject(object));
model->emitChanges();
}
@@ -2525,7 +2525,7 @@ void QQmlDelegateModelGroup::create(QQmlV8Function *args)
that the previously unresolved item has simply moved.
*/
-void QQmlDelegateModelGroup::resolve(QQmlV8Function *args)
+void QQmlDelegateModelGroup::resolve(QQmlV4Function *args)
{
Q_D(QQmlDelegateModelGroup);
if (!d->model)
@@ -2533,7 +2533,7 @@ void QQmlDelegateModelGroup::resolve(QQmlV8Function *args)
QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model);
- if (args->Length() < 2)
+ if (args->length() < 2)
return;
int from = -1;
@@ -2625,7 +2625,7 @@ void QQmlDelegateModelGroup::resolve(QQmlV8Function *args)
Removes \a count items starting at \a index from the group.
*/
-void QQmlDelegateModelGroup::remove(QQmlV8Function *args)
+void QQmlDelegateModelGroup::remove(QQmlV4Function *args)
{
Q_D(QQmlDelegateModelGroup);
if (!d->model)
@@ -2634,7 +2634,7 @@ void QQmlDelegateModelGroup::remove(QQmlV8Function *args)
int index = -1;
int count = 1;
- if (args->Length() == 0)
+ if (args->length() == 0)
return;
int i = 0;
@@ -2644,7 +2644,7 @@ void QQmlDelegateModelGroup::remove(QQmlV8Function *args)
return;
}
- if (++i < args->Length()) {
+ if (++i < args->length()) {
v = (*args)[i];
if (v->IsInt32())
count = v->Int32Value();
@@ -2664,12 +2664,12 @@ void QQmlDelegateModelGroup::remove(QQmlV8Function *args)
}
bool QQmlDelegateModelGroupPrivate::parseGroupArgs(
- QQmlV8Function *args, Compositor::Group *group, int *index, int *count, int *groups) const
+ QQmlV4Function *args, Compositor::Group *group, int *index, int *count, int *groups) const
{
if (!model || !QQmlDelegateModelPrivate::get(model)->m_cacheMetaType)
return false;
- if (args->Length() < 2)
+ if (args->length() < 2)
return false;
int i = 0;
@@ -2681,7 +2681,7 @@ bool QQmlDelegateModelGroupPrivate::parseGroupArgs(
if (v->IsInt32()) {
*count = v->Int32Value();
- if (++i == args->Length())
+ if (++i == args->length())
return false;
v = (*args)[i];
}
@@ -2697,7 +2697,7 @@ bool QQmlDelegateModelGroupPrivate::parseGroupArgs(
Adds \a count items starting at \a index to \a groups.
*/
-void QQmlDelegateModelGroup::addGroups(QQmlV8Function *args)
+void QQmlDelegateModelGroup::addGroups(QQmlV4Function *args)
{
Q_D(QQmlDelegateModelGroup);
Compositor::Group group = d->group;
@@ -2727,7 +2727,7 @@ void QQmlDelegateModelGroup::addGroups(QQmlV8Function *args)
Removes \a count items starting at \a index from \a groups.
*/
-void QQmlDelegateModelGroup::removeGroups(QQmlV8Function *args)
+void QQmlDelegateModelGroup::removeGroups(QQmlV4Function *args)
{
Q_D(QQmlDelegateModelGroup);
Compositor::Group group = d->group;
@@ -2757,7 +2757,7 @@ void QQmlDelegateModelGroup::removeGroups(QQmlV8Function *args)
Sets the \a groups \a count items starting at \a index belong to.
*/
-void QQmlDelegateModelGroup::setGroups(QQmlV8Function *args)
+void QQmlDelegateModelGroup::setGroups(QQmlV4Function *args)
{
Q_D(QQmlDelegateModelGroup);
Compositor::Group group = d->group;
@@ -2793,11 +2793,11 @@ void QQmlDelegateModelGroup::setGroups(QQmlV8Function *args)
Moves \a count at \a from in a group \a to a new position.
*/
-void QQmlDelegateModelGroup::move(QQmlV8Function *args)
+void QQmlDelegateModelGroup::move(QQmlV4Function *args)
{
Q_D(QQmlDelegateModelGroup);
- if (args->Length() < 2)
+ if (args->length() < 2)
return;
Compositor::Group fromGroup = d->group;
@@ -2816,7 +2816,7 @@ void QQmlDelegateModelGroup::move(QQmlV8Function *args)
return;
}
- if (args->Length() > 2) {
+ if (args->length() > 2) {
v8::Handle<v8::Value> v = (*args)[2];
if (v->IsInt32())
count = v->Int32Value();
diff --git a/src/qml/types/qqmldelegatemodel_p.h b/src/qml/types/qqmldelegatemodel_p.h
index d1cdd52bd3..6f2acf0924 100644
--- a/src/qml/types/qqmldelegatemodel_p.h
+++ b/src/qml/types/qqmldelegatemodel_p.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
class QQmlChangeSet;
class QQmlComponent;
class QQuickPackage;
-class QQmlV8Function;
+class QQmlV4Function;
class QQmlDelegateModelGroup;
class QQmlDelegateModelAttached;
class QQmlDelegateModelPrivate;
@@ -168,14 +168,14 @@ public:
Q_INVOKABLE QQmlV4Handle get(int index);
public Q_SLOTS:
- void insert(QQmlV8Function *);
- void create(QQmlV8Function *);
- void resolve(QQmlV8Function *);
- void remove(QQmlV8Function *);
- void addGroups(QQmlV8Function *);
- void removeGroups(QQmlV8Function *);
- void setGroups(QQmlV8Function *);
- void move(QQmlV8Function *);
+ void insert(QQmlV4Function *);
+ void create(QQmlV4Function *);
+ void resolve(QQmlV4Function *);
+ void remove(QQmlV4Function *);
+ void addGroups(QQmlV4Function *);
+ void removeGroups(QQmlV4Function *);
+ void setGroups(QQmlV4Function *);
+ void move(QQmlV4Function *);
Q_SIGNALS:
void countChanged();
diff --git a/src/qml/types/qqmldelegatemodel_p_p.h b/src/qml/types/qqmldelegatemodel_p_p.h
index 16ecdd80be..9311ad0598 100644
--- a/src/qml/types/qqmldelegatemodel_p_p.h
+++ b/src/qml/types/qqmldelegatemodel_p_p.h
@@ -215,7 +215,7 @@ public:
bool parseIndex(const v8::Handle<v8::Value> &value, int *index, Compositor::Group *group) const;
bool parseGroupArgs(
- QQmlV8Function *args, Compositor::Group *group, int *index, int *count, int *groups) const;
+ QQmlV4Function *args, Compositor::Group *group, int *index, int *count, int *groups) const;
Compositor::Group group;
QQmlGuard<QQmlDelegateModel> model;
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp
index 23a41d426b..d44773cb78 100644
--- a/src/qml/types/qqmllistmodel.cpp
+++ b/src/qml/types/qqmllistmodel.cpp
@@ -1894,13 +1894,13 @@ void QQmlListModel::clear()
\sa clear()
*/
-void QQmlListModel::remove(QQmlV8Function *args)
+void QQmlListModel::remove(QQmlV4Function *args)
{
- int argLength = args->Length();
+ int argLength = args->length();
if (argLength == 1 || argLength == 2) {
- int index = (*args)[0]->Int32Value();
- int removeCount = (argLength == 2 ? ((*args)[1]->Int32Value()) : 1);
+ int index = (*args)[0].toInt32();
+ int removeCount = (argLength == 2 ? (*args)[1].toInt32() : 1);
if (index < 0 || index+removeCount > count() || removeCount <= 0) {
qmlInfo(this) << tr("remove: indices [%1 - %2] out of range [0 - %3]").arg(index).arg(index+removeCount).arg(count());
@@ -1937,9 +1937,9 @@ void QQmlListModel::remove(QQmlV8Function *args)
\sa set(), append()
*/
-void QQmlListModel::insert(QQmlV8Function *args)
+void QQmlListModel::insert(QQmlV4Function *args)
{
- if (args->Length() == 2) {
+ if (args->length() == 2) {
v8::Handle<v8::Value> arg0 = (*args)[0];
int index = arg0->Int32Value();
@@ -2047,9 +2047,9 @@ void QQmlListModel::move(int from, int to, int n)
\sa set(), remove()
*/
-void QQmlListModel::append(QQmlV8Function *args)
+void QQmlListModel::append(QQmlV4Function *args)
{
- if (args->Length() == 1) {
+ if (args->length() == 1) {
v8::Handle<v8::Value> arg = (*args)[0];
if (arg->IsArray()) {
diff --git a/src/qml/types/qqmllistmodel_p.h b/src/qml/types/qqmllistmodel_p.h
index 312abb6673..722cb2b44d 100644
--- a/src/qml/types/qqmllistmodel_p.h
+++ b/src/qml/types/qqmllistmodel_p.h
@@ -81,9 +81,9 @@ public:
int count() const;
Q_INVOKABLE void clear();
- Q_INVOKABLE void remove(QQmlV8Function *args);
- Q_INVOKABLE void append(QQmlV8Function *args);
- Q_INVOKABLE void insert(QQmlV8Function *args);
+ Q_INVOKABLE void remove(QQmlV4Function *args);
+ Q_INVOKABLE void append(QQmlV4Function *args);
+ Q_INVOKABLE void insert(QQmlV4Function *args);
Q_INVOKABLE QQmlV4Handle get(int index) const;
Q_INVOKABLE void set(int index, const QQmlV4Handle &);
Q_INVOKABLE void setProperty(int index, const QString& property, const QVariant& value);
diff --git a/src/qml/types/qqmllistmodelworkeragent.cpp b/src/qml/types/qqmllistmodelworkeragent.cpp
index 827fe03c61..1dc5fcf953 100644
--- a/src/qml/types/qqmllistmodelworkeragent.cpp
+++ b/src/qml/types/qqmllistmodelworkeragent.cpp
@@ -132,17 +132,17 @@ void QQmlListModelWorkerAgent::clear()
m_copy->clear();
}
-void QQmlListModelWorkerAgent::remove(QQmlV8Function *args)
+void QQmlListModelWorkerAgent::remove(QQmlV4Function *args)
{
m_copy->remove(args);
}
-void QQmlListModelWorkerAgent::append(QQmlV8Function *args)
+void QQmlListModelWorkerAgent::append(QQmlV4Function *args)
{
m_copy->append(args);
}
-void QQmlListModelWorkerAgent::insert(QQmlV8Function *args)
+void QQmlListModelWorkerAgent::insert(QQmlV4Function *args)
{
m_copy->insert(args);
}
diff --git a/src/qml/types/qqmllistmodelworkeragent_p.h b/src/qml/types/qqmllistmodelworkeragent_p.h
index a76f66005b..1299d81c56 100644
--- a/src/qml/types/qqmllistmodelworkeragent_p.h
+++ b/src/qml/types/qqmllistmodelworkeragent_p.h
@@ -81,9 +81,9 @@ public:
int count() const;
Q_INVOKABLE void clear();
- Q_INVOKABLE void remove(QQmlV8Function *args);
- Q_INVOKABLE void append(QQmlV8Function *args);
- Q_INVOKABLE void insert(QQmlV8Function *args);
+ Q_INVOKABLE void remove(QQmlV4Function *args);
+ Q_INVOKABLE void append(QQmlV4Function *args);
+ Q_INVOKABLE void insert(QQmlV4Function *args);
Q_INVOKABLE QQmlV4Handle get(int index) const;
Q_INVOKABLE void set(int index, const QQmlV4Handle &);
Q_INVOKABLE void setProperty(int index, const QString& property, const QVariant& value);
diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp
index 6a98621783..b0822968e3 100644
--- a/src/qml/types/qquickworkerscript.cpp
+++ b/src/qml/types/qquickworkerscript.cpp
@@ -652,7 +652,7 @@ void QQuickWorkerScript::setSource(const QUrl &source)
of ListModel objects, any modifications by the other thread to an object
passed in \c message will not be reflected in the original object.
*/
-void QQuickWorkerScript::sendMessage(QQmlV8Function *args)
+void QQuickWorkerScript::sendMessage(QQmlV4Function *args)
{
if (!engine()) {
qWarning("QQuickWorkerScript: Attempt to send message before WorkerScript establishment");
@@ -660,7 +660,7 @@ void QQuickWorkerScript::sendMessage(QQmlV8Function *args)
}
v8::Handle<v8::Value> argument = QV4::Value::undefinedValue();
- if (args->Length() != 0)
+ if (args->length() != 0)
argument = (*args)[0];
m_engine->sendMessage(m_scriptId, QV8Worker::serialize(argument, args->engine()));
diff --git a/src/qml/types/qquickworkerscript_p.h b/src/qml/types/qquickworkerscript_p.h
index 7921b90295..bf23a3f2a2 100644
--- a/src/qml/types/qquickworkerscript_p.h
+++ b/src/qml/types/qquickworkerscript_p.h
@@ -84,7 +84,7 @@ private:
QQuickWorkerScriptEnginePrivate *d;
};
-class QQmlV8Function;
+class QQmlV4Function;
class QQmlV4Handle;
class Q_AUTOTEST_EXPORT QQuickWorkerScript : public QObject, public QQmlParserStatus
{
@@ -100,7 +100,7 @@ public:
void setSource(const QUrl &);
public slots:
- void sendMessage(QQmlV8Function*);
+ void sendMessage(QQmlV4Function*);
signals:
void sourceChanged();