diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-01-11 04:23:01 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-01-11 04:23:01 (GMT) |
commit | d7279368fac43e88157f5d4b90a38aeea1cc3e73 (patch) | |
tree | b3be0351c436bf7da3818a09cc561c472eabf086 /src/declarative | |
parent | ece224f79dfe3b859910cb24d64e96277b3c737f (diff) | |
download | Qt-d7279368fac43e88157f5d4b90a38aeea1cc3e73.zip Qt-d7279368fac43e88157f5d4b90a38aeea1cc3e73.tar.gz Qt-d7279368fac43e88157f5d4b90a38aeea1cc3e73.tar.bz2 |
Update QML to adhere to latest QScriptDeclarativeClass
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qmlcontextscriptclass.cpp | 3 | ||||
-rw-r--r-- | src/declarative/qml/qmlcontextscriptclass_p.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmllistscriptclass.cpp | 6 | ||||
-rw-r--r-- | src/declarative/qml/qmllistscriptclass_p.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlobjectscriptclass.cpp | 20 | ||||
-rw-r--r-- | src/declarative/qml/qmlobjectscriptclass_p.h | 4 | ||||
-rw-r--r-- | src/declarative/qml/qmltypenamescriptclass.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmltypenamescriptclass_p.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlvaluetypescriptclass.cpp | 5 | ||||
-rw-r--r-- | src/declarative/qml/qmlvaluetypescriptclass_p.h | 2 |
10 files changed, 26 insertions, 22 deletions
diff --git a/src/declarative/qml/qmlcontextscriptclass.cpp b/src/declarative/qml/qmlcontextscriptclass.cpp index 588a397..8ab3f8d 100644 --- a/src/declarative/qml/qmlcontextscriptclass.cpp +++ b/src/declarative/qml/qmlcontextscriptclass.cpp @@ -196,7 +196,8 @@ QmlContextScriptClass::queryProperty(QmlContext *bindContext, QObject *scopeObje return 0; } -QScriptValue QmlContextScriptClass::property(Object *object, const Identifier &name) +QmlContextScriptClass::Value +QmlContextScriptClass::property(Object *object, const Identifier &name) { Q_UNUSED(object); diff --git a/src/declarative/qml/qmlcontextscriptclass_p.h b/src/declarative/qml/qmlcontextscriptclass_p.h index a577d52..f652371 100644 --- a/src/declarative/qml/qmlcontextscriptclass_p.h +++ b/src/declarative/qml/qmlcontextscriptclass_p.h @@ -77,7 +77,7 @@ public: protected: virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &, QScriptClass::QueryFlags flags); - virtual QScriptValue property(Object *, const Identifier &); + virtual Value property(Object *, const Identifier &); virtual void setProperty(Object *, const Identifier &name, const QScriptValue &); private: diff --git a/src/declarative/qml/qmllistscriptclass.cpp b/src/declarative/qml/qmllistscriptclass.cpp index f5ff2c0..b275625 100644 --- a/src/declarative/qml/qmllistscriptclass.cpp +++ b/src/declarative/qml/qmllistscriptclass.cpp @@ -100,7 +100,7 @@ QmlListScriptClass::queryProperty(Object *object, const Identifier &name, } } -QScriptValue QmlListScriptClass::property(Object *obj, const Identifier &name) +QmlListScriptClass::Value QmlListScriptClass::property(Object *obj, const Identifier &name) { QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine); QmlEnginePrivate *enginePriv = QmlEnginePrivate::get(engine); @@ -123,7 +123,7 @@ QScriptValue QmlListScriptClass::property(Object *obj, const Identifier &name) quint32 count = qlist.count(); if (name == m_lengthId.identifier) - return count; + return Value(scriptEngine, count); else if (lastIndex < count) return enginePriv->objectClass->newQObject(qlist.at(lastIndex)); else @@ -136,7 +136,7 @@ QScriptValue QmlListScriptClass::property(Object *obj, const Identifier &name) quint32 count = qmllist.count(); if (name == m_lengthId.identifier) - return count; + return Value(scriptEngine, count); else if (lastIndex < count) return enginePriv->objectClass->newQObject(qmllist.at(lastIndex)); else diff --git a/src/declarative/qml/qmllistscriptclass_p.h b/src/declarative/qml/qmllistscriptclass_p.h index 0c10472..43ca929 100644 --- a/src/declarative/qml/qmllistscriptclass_p.h +++ b/src/declarative/qml/qmllistscriptclass_p.h @@ -70,7 +70,7 @@ public: protected: virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &, QScriptClass::QueryFlags flags); - virtual QScriptValue property(Object *, const Identifier &); + virtual Value property(Object *, const Identifier &); private: PersistentIdentifier m_lengthId; diff --git a/src/declarative/qml/qmlobjectscriptclass.cpp b/src/declarative/qml/qmlobjectscriptclass.cpp index cb665d1..1023579 100644 --- a/src/declarative/qml/qmlobjectscriptclass.cpp +++ b/src/declarative/qml/qmlobjectscriptclass.cpp @@ -189,12 +189,14 @@ QmlObjectScriptClass::queryProperty(QObject *obj, const Identifier &name, return 0; } -QScriptValue QmlObjectScriptClass::property(Object *object, const Identifier &name) +QmlObjectScriptClass::Value +QmlObjectScriptClass::property(Object *object, const Identifier &name) { return property(toQObject(object), name); } -QScriptValue QmlObjectScriptClass::property(QObject *obj, const Identifier &name) +QmlObjectScriptClass::Value +QmlObjectScriptClass::property(QObject *obj, const Identifier &name) { if (name == m_destroyId.identifier) return m_destroy; @@ -256,37 +258,37 @@ QScriptValue QmlObjectScriptClass::property(QObject *obj, const Identifier &name qreal rv = 0; void *args[] = { &rv, 0 }; QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args); - return QScriptValue(scriptEngine, rv); + return Value(scriptEngine, rv); } else if (lastData->propType == QMetaType::Int) { int rv = 0; void *args[] = { &rv, 0 }; QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args); - return QScriptValue(scriptEngine, rv); + return Value(scriptEngine, rv); } else if (lastData->propType == QMetaType::Bool) { bool rv = false; void *args[] = { &rv, 0 }; QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args); - return QScriptValue(scriptEngine, rv); + return Value(scriptEngine, rv); } else if (lastData->propType == QMetaType::QString) { QString rv; void *args[] = { &rv, 0 }; QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args); - return QScriptValue(scriptEngine, rv); + return Value(scriptEngine, rv); } else if (lastData->propType == QMetaType::UInt) { uint rv = 0; void *args[] = { &rv, 0 }; QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args); - return QScriptValue(scriptEngine, rv); + return Value(scriptEngine, rv); } else if (lastData->propType == QMetaType::Float) { float rv = 0; void *args[] = { &rv, 0 }; QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args); - return QScriptValue(scriptEngine, rv); + return Value(scriptEngine, rv); } else if (lastData->propType == QMetaType::Double) { double rv = 0; void *args[] = { &rv, 0 }; QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args); - return QScriptValue(scriptEngine, rv); + return Value(scriptEngine, rv); } else { QVariant var = obj->metaObject()->property(lastData->coreIndex).read(obj); return enginePriv->scriptValueFromVariant(var); diff --git a/src/declarative/qml/qmlobjectscriptclass_p.h b/src/declarative/qml/qmlobjectscriptclass_p.h index ca50688..5c488db 100644 --- a/src/declarative/qml/qmlobjectscriptclass_p.h +++ b/src/declarative/qml/qmlobjectscriptclass_p.h @@ -86,7 +86,7 @@ public: QScriptClass::QueryFlags flags, QmlContext *evalContext, QueryHints hints = 0); - QScriptValue property(QObject *, const Identifier &); + Value property(QObject *, const Identifier &); void setProperty(QObject *, const Identifier &name, const QScriptValue &, QmlContext *evalContext = 0); @@ -94,7 +94,7 @@ protected: virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &, QScriptClass::QueryFlags flags); - virtual QScriptValue property(Object *, const Identifier &); + virtual Value property(Object *, const Identifier &); virtual void setProperty(Object *, const Identifier &name, const QScriptValue &); virtual bool isQObject() const; virtual QObject *toQObject(Object *, bool *ok = 0); diff --git a/src/declarative/qml/qmltypenamescriptclass.cpp b/src/declarative/qml/qmltypenamescriptclass.cpp index 72106ae..c4c5f53 100644 --- a/src/declarative/qml/qmltypenamescriptclass.cpp +++ b/src/declarative/qml/qmltypenamescriptclass.cpp @@ -139,7 +139,7 @@ QmlTypeNameScriptClass::queryProperty(Object *obj, const Identifier &name, return 0; } -QScriptValue QmlTypeNameScriptClass::property(Object *obj, const Identifier &name) +QmlTypeNameScriptClass::Value QmlTypeNameScriptClass::property(Object *obj, const Identifier &name) { QmlEnginePrivate *ep = QmlEnginePrivate::get(engine); if (type) { diff --git a/src/declarative/qml/qmltypenamescriptclass_p.h b/src/declarative/qml/qmltypenamescriptclass_p.h index e72c05c..702930f 100644 --- a/src/declarative/qml/qmltypenamescriptclass_p.h +++ b/src/declarative/qml/qmltypenamescriptclass_p.h @@ -77,7 +77,7 @@ protected: virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &, QScriptClass::QueryFlags flags); - virtual QScriptValue property(Object *, const Identifier &); + virtual Value property(Object *, const Identifier &); virtual void setProperty(Object *, const Identifier &name, const QScriptValue &); private: diff --git a/src/declarative/qml/qmlvaluetypescriptclass.cpp b/src/declarative/qml/qmlvaluetypescriptclass.cpp index 78580e3..65a63f4 100644 --- a/src/declarative/qml/qmlvaluetypescriptclass.cpp +++ b/src/declarative/qml/qmlvaluetypescriptclass.cpp @@ -67,7 +67,8 @@ QScriptValue QmlValueTypeScriptClass::newObject(QObject *object, int coreIndex, ref->type = type; ref->object = object; ref->property = coreIndex; - return QScriptDeclarativeClass::newObject(QmlEnginePrivate::getScriptEngine(engine), this, ref); + QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine); + return QScriptDeclarativeClass::newObject(scriptEngine, this, ref); } QScriptClass::QueryFlags @@ -97,7 +98,7 @@ QmlValueTypeScriptClass::queryProperty(Object *obj, const Identifier &name, return rv; } -QScriptValue QmlValueTypeScriptClass::property(Object *obj, const Identifier &) +QmlValueTypeScriptClass::Value QmlValueTypeScriptClass::property(Object *obj, const Identifier &) { QmlValueTypeReference *ref = static_cast<QmlValueTypeReference *>(obj); diff --git a/src/declarative/qml/qmlvaluetypescriptclass_p.h b/src/declarative/qml/qmlvaluetypescriptclass_p.h index 98d0251..9214987 100644 --- a/src/declarative/qml/qmlvaluetypescriptclass_p.h +++ b/src/declarative/qml/qmlvaluetypescriptclass_p.h @@ -70,7 +70,7 @@ public: virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &, QScriptClass::QueryFlags flags); - virtual QScriptValue property(Object *, const Identifier &); + virtual Value property(Object *, const Identifier &); virtual void setProperty(Object *, const Identifier &name, const QScriptValue &); virtual QVariant toVariant(Object *, bool *ok = 0); |