diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-26 12:34:53 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-28 13:33:54 +0200 |
commit | 112531bc23494ba3c5cf2e0a51b2d654be28dbfd (patch) | |
tree | 4a87c09e6e4b59654819977537aa8e6b70fcfbad /src/qml/jsruntime/qv4value_def_p.h | |
parent | c0e0e9ba2c1dd8c3a2a590849ff244987730d1b2 (diff) |
Less QV4::Value usage
Fix some usages in qv4engine, and fix return types
in methods in qqmlxmlhttprequest.
Change-Id: I3d6225ca01bf7ea77fcc424914c8392bb6c3a454
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4value_def_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4value_def_p.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4value_def_p.h b/src/qml/jsruntime/qv4value_def_p.h index bc73a85e04..3e6c19207a 100644 --- a/src/qml/jsruntime/qv4value_def_p.h +++ b/src/qml/jsruntime/qv4value_def_p.h @@ -338,6 +338,12 @@ struct SafeValue : public Value return *this; } template<typename T> + SafeValue &operator=(T *t) { + val = Value::fromManaged(t).val; + return *this; + } + + template<typename T> SafeValue &operator=(const Scoped<T> &t); SafeValue &operator=(const ValueRef v); SafeValue &operator=(const Value &v) { @@ -369,10 +375,15 @@ struct Q_QML_EXPORT Primitive : public Value template <typename T> struct Safe : public SafeValue { + template<typename X> + Safe &operator =(X *x) { + val = Value::fromManaged(x).val; + } Safe &operator =(T *t); Safe &operator =(const Scoped<T> &v); Safe &operator =(const Referenced<T> &v); Safe &operator =(Returned<T> *t); + Safe &operator =(const Safe<T> &t); // ### GC: remove me |