summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-04-07 04:25:54 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-04-07 04:26:46 (GMT)
commitec50ac021ba0908bfaeb5fbf1838ffb59ad829d5 (patch)
tree1a6365c8b7487e4f5cf7e489aba8005797005e3c /src/declarative/qml/qdeclarativeobjectscriptclass.cpp
parentb3beb6ded506f1701b68642d981c63295bc6c6a2 (diff)
downloadQt-ec50ac021ba0908bfaeb5fbf1838ffb59ad829d5.zip
Qt-ec50ac021ba0908bfaeb5fbf1838ffb59ad829d5.tar.gz
Qt-ec50ac021ba0908bfaeb5fbf1838ffb59ad829d5.tar.bz2
Cleanup (remove QDeclarativeScriptClass)
QDeclarativeScriptClass only existed to make compiling against 4.6 and 4.7 easier.
Diffstat (limited to 'src/declarative/qml/qdeclarativeobjectscriptclass.cpp')
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
index 759a506..10b9fab 100644
--- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
@@ -78,11 +78,8 @@ struct ObjectData : public QScriptDeclarativeClass::Object {
QtScript for QML.
*/
QDeclarativeObjectScriptClass::QDeclarativeObjectScriptClass(QDeclarativeEngine *bindEngine)
-: QDeclarativeScriptClass(QDeclarativeEnginePrivate::getScriptEngine(bindEngine)),
-#if (QT_VERSION > QT_VERSION_CHECK(4, 6, 2)) || defined(QT_HAVE_QSCRIPTDECLARATIVECLASS_VALUE)
- methods(bindEngine),
-#endif
- lastData(0), engine(bindEngine)
+: QScriptDeclarativeClass(QDeclarativeEnginePrivate::getScriptEngine(bindEngine)),
+ methods(bindEngine), lastData(0), engine(bindEngine)
{
QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
@@ -191,13 +188,13 @@ QDeclarativeObjectScriptClass::queryProperty(QObject *obj, const Identifier &nam
return 0;
}
-QDeclarativeObjectScriptClass::ScriptValue
+QDeclarativeObjectScriptClass::Value
QDeclarativeObjectScriptClass::property(Object *object, const Identifier &name)
{
return property(toQObject(object), name);
}
-QDeclarativeObjectScriptClass::ScriptValue
+QDeclarativeObjectScriptClass::Value
QDeclarativeObjectScriptClass::property(QObject *obj, const Identifier &name)
{
QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
@@ -357,7 +354,7 @@ void QDeclarativeObjectScriptClass::setProperty(QObject *obj,
QMetaObject::metacall(obj, QMetaObject::ResetProperty, lastData->coreIndex, a);
} else {
// ### Can well known types be optimized?
- QVariant v = QDeclarativeScriptClass::toVariant(engine, value);
+ QVariant v = enginePriv->scriptValueToVariant(value);
QDeclarativePropertyPrivate::write(obj, *lastData, v, evalContext);
}
}
@@ -557,7 +554,7 @@ QDeclarativeObjectMethodScriptClass::queryProperty(Object *, const Identifier &n
}
-QDeclarativeObjectScriptClass::ScriptValue
+QDeclarativeObjectMethodScriptClass::Value
QDeclarativeObjectMethodScriptClass::property(Object *, const Identifier &name)
{
QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
@@ -687,7 +684,7 @@ void MetaCallArgument::fromScriptValue(int callType, QDeclarativeEngine *engine,
*((QObject **)&data) = value.toQObject();
type = callType;
} else if (callType == qMetaTypeId<QVariant>()) {
- new (&data) QVariant(QDeclarativeScriptClass::toVariant(engine, value));
+ new (&data) QVariant(QDeclarativeEnginePrivate::get(engine)->scriptValueToVariant(value));
type = callType;
} else if (callType == qMetaTypeId<QList<QObject*> >()) {
new (&data) QList<QObject *>(); // We don't support passing in QList<QObject*>
@@ -696,7 +693,7 @@ void MetaCallArgument::fromScriptValue(int callType, QDeclarativeEngine *engine,
new (&data) QVariant();
type = -1;
- QVariant v = QDeclarativeScriptClass::toVariant(engine, value);
+ QVariant v = QDeclarativeEnginePrivate::get(engine)->scriptValueToVariant(value);
if (v.userType() == callType) {
*((QVariant *)&data) = v;
} else if (v.canConvert((QVariant::Type)callType)) {