diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2009-12-01 06:05:38 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-12-01 06:05:38 (GMT) |
commit | ad41250b0af1f4207b267e1dfa9fb1e03ee01828 (patch) | |
tree | 7b747a304281f06a05f913628f3c78169f3b05d7 /src | |
parent | 0f9ab237626adbd83c29cf6579aeb74f101d22ea (diff) | |
parent | a539ce478800c3dacf8456d206e8fd6dc700ac5c (diff) | |
download | Qt-ad41250b0af1f4207b267e1dfa9fb1e03ee01828.zip Qt-ad41250b0af1f4207b267e1dfa9fb1e03ee01828.tar.gz Qt-ad41250b0af1f4207b267e1dfa9fb1e03ee01828.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.5
Diffstat (limited to 'src')
-rw-r--r-- | src/script/qscriptextqobject.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/script/qscriptextqobject.cpp b/src/script/qscriptextqobject.cpp index b3b9a548..4be6b72 100644 --- a/src/script/qscriptextqobject.cpp +++ b/src/script/qscriptextqobject.cpp @@ -1657,12 +1657,27 @@ void QScript::QObjectConnectionManager::execute(int slotIndex, void **argv) activation_data->m_members[i].object(nameId, i, QScriptValue::Undeletable | QScriptValue::SkipInEnumeration); + QScriptValueImpl actual; if (i < argc) { - int argType = QMetaType::type(parameterTypes.at(i)); - activation_data->m_values[i] = eng->create(argType, argv[i + 1]); + void *arg = argv[i + 1]; + QByteArray typeName = parameterTypes.at(i); + int argType = QMetaType::type(typeName); + if (!argType) { + if (typeName == "QVariant") { + actual = eng->valueFromVariant(*reinterpret_cast<QVariant*>(arg)); + } else { + qWarning("QScriptEngine: Unable to handle unregistered datatype '%s' " + "when invoking handler of signal %s::%s", + typeName.constData(), meta->className(), method.signature()); + actual = eng->undefinedValue(); + } + } else { + actual = eng->create(argType, arg); + } } else { - activation_data->m_values[i] = eng->undefinedValue(); + actual = eng->undefinedValue(); } + activation_data->m_values[i] = actual; } QScriptValueImpl senderObject; |