diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2012-08-08 10:23:04 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-15 17:25:37 +0200 |
commit | 75c649276a9bbcb2e593d6c6f78d77417dd05891 (patch) | |
tree | 2e98537cbbb23f589ea236ba8b23d1965ccbe2b5 /src/script/bridge/qscriptqobject.cpp | |
parent | df0ec196031d33850324dc5eeed2d71f61413885 (diff) |
Remove the use of the QWidgetStar metatypeid.
It is to be removed, and is obsoleted by QMetaType::PointerToQObject.
By using QMetaType::PointerToQObject, we also gain the feature
that all pointers to types derived from QObject return true for
QScriptValue::isQObject().
Change-Id: I18392b5b6cde3a45d060c37612d987a5cf8e8f18
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/script/bridge/qscriptqobject.cpp')
-rw-r--r-- | src/script/bridge/qscriptqobject.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp index da1e0d6..e4da978 100644 --- a/src/script/bridge/qscriptqobject.cpp +++ b/src/script/bridge/qscriptqobject.cpp @@ -713,18 +713,17 @@ static JSC::JSValue delegateQtMethod(JSC::ExecState *exec, QMetaMethod::MethodTy } else if (QScriptEnginePrivate::isQObject(actual)) { switch (tid) { case QMetaType::QObjectStar: - case QMetaType::QWidgetStar: // perfect break; default: - matchDistance += 10; + if (!(QMetaType::typeFlags(tid) & QMetaType::PointerToQObject)) + matchDistance += 10; break; } } else if (actual.isNull()) { switch (tid) { case QMetaType::VoidStar: case QMetaType::QObjectStar: - case QMetaType::QWidgetStar: // perfect break; default: |