aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4persistent_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4persistent_p.h')
-rw-r--r--src/qml/jsruntime/qv4persistent_p.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4persistent_p.h b/src/qml/jsruntime/qv4persistent_p.h
index 90e62e7aac..858734e9ed 100644
--- a/src/qml/jsruntime/qv4persistent_p.h
+++ b/src/qml/jsruntime/qv4persistent_p.h
@@ -129,6 +129,7 @@ class Q_QML_EXPORT WeakValue
public:
WeakValue() : val(0) {}
WeakValue(const WeakValue &other);
+ WeakValue(ExecutionEngine *engine, const Value &value);
WeakValue &operator=(const WeakValue &other);
~WeakValue();
@@ -147,6 +148,12 @@ public:
return 0;
return val->as<Managed>();
}
+ template <typename T>
+ T *as() const {
+ if (!val)
+ return 0;
+ return val->as<T>();
+ }
ExecutionEngine *engine() const {
if (!val)