diff options
author | Matthew Vogt <matthew.vogt@nokia.com> | 2012-06-04 14:43:38 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-09 01:36:23 +0200 |
commit | 49a3883e86b61d8facfeea9c43037d484cb50b92 (patch) | |
tree | ba1afdf6ddc3740f26c5e3c95cb2fffeb953abb4 /tests/auto/qml/qqmlecmascript/testtypes.cpp | |
parent | 3095493a4ce4bec11b9381a3d1d23f17b313332c (diff) |
Use V4 binding for non-final properties where possible
When a property referenced in a binding is not marked as final, do not
automatically abort optimization. Instead generate both V4 and V8
binidngs, and only fall back to the V8 binding if necessary at run time.
Change-Id: I1bcc7e2b495935c5d519a9a223f640c1972cdb4e
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/testtypes.cpp')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/testtypes.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/testtypes.cpp b/tests/auto/qml/qqmlecmascript/testtypes.cpp index f488c6a14e..b02e9963ab 100644 --- a/tests/auto/qml/qqmlecmascript/testtypes.cpp +++ b/tests/auto/qml/qqmlecmascript/testtypes.cpp @@ -157,6 +157,22 @@ static QObject *qobject_api_engine_parent(QQmlEngine *engine, QJSEngine *scriptE return o; } +static QObject *fallback_bindings_object(QQmlEngine *engine, QJSEngine *scriptEngine) +{ + Q_UNUSED(engine) + Q_UNUSED(scriptEngine) + + return new FallbackBindingsObject(); +} + +static QObject *fallback_bindings_derived(QQmlEngine *engine, QJSEngine *scriptEngine) +{ + Q_UNUSED(engine) + Q_UNUSED(scriptEngine) + + return new FallbackBindingsDerived(); +} + class MyWorkerObjectThread : public QThread { public: @@ -231,6 +247,12 @@ void registerTypes() qmlRegisterType<MySequenceConversionObject>("Qt.test", 1, 0, "MySequenceConversionObject"); qmlRegisterType<MyUnregisteredEnumTypeObject>("Qt.test", 1, 0, "MyUnregisteredEnumTypeObject"); + + qmlRegisterModuleApi<FallbackBindingsObject>("Qt.test.fallbackBindingsObject", 1, 0, fallback_bindings_object); + qmlRegisterModuleApi<FallbackBindingsObject>("Qt.test.fallbackBindingsDerived", 1, 0, fallback_bindings_derived); + + qmlRegisterType<FallbackBindingsTypeObject>("Qt.test.fallbackBindingsObject", 1, 0, "FallbackBindingsType"); + qmlRegisterType<FallbackBindingsTypeDerived>("Qt.test.fallbackBindingsDerived", 1, 0, "FallbackBindingsType"); } #include "testtypes.moc" |