summaryrefslogtreecommitdiffstats
path: root/examples/script/customclass/bytearrayclass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/script/customclass/bytearrayclass.cpp')
-rw-r--r--examples/script/customclass/bytearrayclass.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/script/customclass/bytearrayclass.cpp b/examples/script/customclass/bytearrayclass.cpp
index 5ecee0a..7bf6d3f 100644
--- a/examples/script/customclass/bytearrayclass.cpp
+++ b/examples/script/customclass/bytearrayclass.cpp
@@ -88,7 +88,7 @@ ByteArrayClass::ByteArrayClass(QScriptEngine *engine)
proto.setPrototype(global.property("Object").property("prototype"));
ctor = engine->newFunction(construct, proto);
- ctor.setData(qScriptValueFromValue(engine, this));
+ ctor.setData(engine->toScriptValue(this));
}
//! [0]
@@ -204,7 +204,7 @@ QScriptValue ByteArrayClass::newInstance(int size)
//! [1]
QScriptValue ByteArrayClass::newInstance(const QByteArray &ba)
{
- QScriptValue data = engine()->newVariant(qVariantFromValue(ba));
+ QScriptValue data = engine()->newVariant(QVariant::fromValue(ba));
return engine()->newObject(this, data);
}
//! [1]
@@ -228,7 +228,7 @@ QScriptValue ByteArrayClass::toScriptValue(QScriptEngine *eng, const QByteArray
QScriptValue ctor = eng->globalObject().property("ByteArray");
ByteArrayClass *cls = qscriptvalue_cast<ByteArrayClass*>(ctor.data());
if (!cls)
- return eng->newVariant(qVariantFromValue(ba));
+ return eng->newVariant(QVariant::fromValue(ba));
return cls->newInstance(ba);
}