diff options
author | Jędrzej Nowacki <jedrzej.nowacki@nokia.com> | 2011-09-16 14:06:02 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-19 13:25:39 +0200 |
commit | 8de9a07c654492a60726e84332bba43cc7b81dbd (patch) | |
tree | 9de928d934c301925fe6fe1e15edf851f73b008b /tests/auto/declarative/qdeclarativeecmascript/testtypes.h | |
parent | c970d47d4ec8bed85acc313e22ddb8bbba55618e (diff) |
Unwrap QJSValue from QVariant in QV8Engine::fromVariant
When QML tries to unwrap real value from a QVariant and
the value is a QJSValue instance, then no conversion is needed,
QJSValue already contains a v8 handle.
This patch, for example, solves a problem of emitting QJSValue
instance in a signal that has QVariant as an argument. The QJSValue
can be unwrapped and used as a normal JS value in a connected slot.
This feature may be used also in a plugin model that stores QJSValues
internally. Then the model in data() function can return a QJSValue
which would be understood by QML.
Change-Id: I1d5ede40ce2637123b09839fd848b27ad3af3dda
Reviewed-on: http://codereview.qt-project.org/4451
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/testtypes.h')
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/testtypes.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h index 52b74affa8..ebe8cc59b7 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h +++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h @@ -170,6 +170,7 @@ signals: void anotherBasicSignal(); void thirdBasicSignal(); void signalWithUnknownType(const MyQmlObject::MyType &arg); + void signalWithVariant(const QVariant &arg); public slots: void deleteMe() { delete this; } |