diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-07-15 09:45:00 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-07-15 09:45:00 (GMT) |
commit | 25e41f5bbf3ad288a6b2f9eec0fbef7c5b171744 (patch) | |
tree | 161087ed0d0502c4fddc6805ca8329487bfeab2b | |
parent | 630444819350b9f7a31c34798405c4e6fd53dc62 (diff) | |
download | Qt-25e41f5bbf3ad288a6b2f9eec0fbef7c5b171744.zip Qt-25e41f5bbf3ad288a6b2f9eec0fbef7c5b171744.tar.gz Qt-25e41f5bbf3ad288a6b2f9eec0fbef7c5b171744.tar.bz2 |
implement QObject prototype object
-rw-r--r-- | src/script/bridge/qscriptqobject.cpp | 5 | ||||
-rw-r--r-- | src/script/bridge/qscriptqobject_p.h | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp index 3705e5f..4f19894 100644 --- a/src/script/bridge/qscriptqobject.cpp +++ b/src/script/bridge/qscriptqobject.cpp @@ -1561,7 +1561,10 @@ QObjectPrototype::QObjectPrototype(JSC::ExecState* exec, WTF::PassRefPtr<JSC::St JSC::Structure* prototypeFunctionStructure) : QScriptObject(structure) { - setDelegate(new QObjectDelegate(new QObject(), QScriptEngine::AutoOwnership, /*options=*/0)); + setDelegate(new QObjectDelegate(new QObjectPrototypeObject(), QScriptEngine::AutoOwnership, + QScriptEngine::ExcludeSuperClassMethods + | QScriptEngine::ExcludeSuperClassProperties + | QScriptEngine::ExcludeChildObjects)); putDirectFunction(exec, new (exec) JSC::PrototypeFunction(exec, prototypeFunctionStructure, /*length=*/0, exec->propertyNames().toString, qobjectProtoFuncToString), JSC::DontEnum); putDirectFunction(exec, new (exec) JSC::PrototypeFunction(exec, prototypeFunctionStructure, /*length=*/1, JSC::Identifier(exec, "findChild"), qobjectProtoFuncFindChild), JSC::DontEnum); diff --git a/src/script/bridge/qscriptqobject_p.h b/src/script/bridge/qscriptqobject_p.h index 9008599..766c3c7 100644 --- a/src/script/bridge/qscriptqobject_p.h +++ b/src/script/bridge/qscriptqobject_p.h @@ -96,6 +96,15 @@ protected: Data *data; }; +class QObjectPrototypeObject : public QObject +{ + Q_OBJECT +public: + QObjectPrototypeObject(QObject *parent = 0) + : QObject(parent) { } + ~QObjectPrototypeObject() { } +}; + class QObjectPrototype : public QScriptObject { public: |