Start converting casting of Managed to subtypes to a better scheme
authorLars Knoll <lars.knoll@digia.com>
Fri, 31 May 2013 11:05:37 +0000 (13:05 +0200)
committerSimon Hausmann <simon.hausmann@digia.com>
Fri, 31 May 2013 13:46:27 +0000 (15:46 +0200)
commite14b9dbee1260f799d1d2e175d106dbed79b6c49
tree127bd9fb574a5d62155e93ead4fdcffc3314e664
parent0ced7dfd6991cd33222e7c5a3c05e56d2c67e9d5
Start converting casting of Managed to subtypes to a better scheme

There is now a template based as<Foo>() method available in
Managed, that'll allow casting to the proper subclass. It uses
the pointer to the vtable and compares it to the classes static
vtable for type checking. Like this we can avoid that Managed has
to know about all subclasses.

Change-Id: Ic966bbe00d85224b8d96cc0ff00f69a6ac67129e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
16 files changed:
src/qml/qml/qqmlcontextwrapper.cpp
src/qml/qml/qqmlcontextwrapper_p.h
src/qml/qml/qqmllistwrapper.cpp
src/qml/qml/qqmllistwrapper_p.h
src/qml/qml/qqmltypewrapper.cpp
src/qml/qml/qqmltypewrapper_p.h
src/qml/qml/qqmlvaluetypewrapper.cpp
src/qml/qml/qqmlvaluetypewrapper_p.h
src/qml/qml/v4/qv4managed_p.h
src/qml/qml/v4/qv4sequenceobject.cpp
src/qml/qml/v4/qv4value_p.h
src/qml/qml/v4/qv4variantobject.cpp
src/qml/qml/v8/qv8engine.cpp
src/qml/qml/v8/qv8qobjectwrapper.cpp
src/qml/types/qquickworkerscript.cpp
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp