summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-06-03 13:44:20 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-06-03 13:52:24 (GMT)
commit5e0aef012a90598b88b547b1b73785f59ef135c1 (patch)
tree98d4e3b40a0209ffd0aff6192b0627206c39c34d /src/script
parentc890793e7a58e1d75d1f88f5e2c88162eddcca44 (diff)
downloadQt-5e0aef012a90598b88b547b1b73785f59ef135c1.zip
Qt-5e0aef012a90598b88b547b1b73785f59ef135c1.tar.gz
Qt-5e0aef012a90598b88b547b1b73785f59ef135c1.tar.bz2
fix silly typo
Yeesh. The function worked for the common case of the argument being a plain script object (obviously, otherwise this would have been discovered sooner), but it would never pick the less expensive path when replacing the QObject pointer of an existing proxy. And if you passed in a QVariant proxy (now who would ever do something like that...?), it would assert.
Diffstat (limited to 'src/script')
-rw-r--r--src/script/qscriptengine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/qscriptengine.cpp b/src/script/qscriptengine.cpp
index d8908ed..97021fc 100644
--- a/src/script/qscriptengine.cpp
+++ b/src/script/qscriptengine.cpp
@@ -587,7 +587,7 @@ QScriptValue QScriptEngine::newQObject(const QScriptValue &scriptObject,
QScriptValuePrivate *p = QScriptValuePrivate::get(scriptObject);
if (!p || !p->value.isObject())
return newQObject(qtObject, ownership, options);
- if (p->value.isVariant()) {
+ if (p->value.isQObject()) {
QScript::ExtQObject::Instance *data;
data = d->qobjectConstructor->get(p->value);
Q_ASSERT(data != 0);