diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-01-18 14:01:39 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-20 23:35:18 +0100 |
commit | 174ee897edbea436046cfe0ea02f4185e1e0de34 (patch) | |
tree | 5ec724de6413a6ff4aaf196489cec39f8739956c /src/declarative/qml/v8/qjsvalue.h | |
parent | 95cee5d6e514891aab160c8e1fc4814c147ab3a6 (diff) |
Add QJSValue::callWithInstance() function
With the deprecated call() overload, it was confusing what the first
argument was (the this-object or an actual argument passed to the
function). Introduce a dedicated function for the
"explicit this-object" case. This makes code more readable, and
eliminates the need to pass a "dummy" this-object to call() in the
quite common case where you don't care about the this-object.
Task-number: QTBUG-23604
Change-Id: I18f8be6592a848436351516bea266fc7e9195777
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Diffstat (limited to 'src/declarative/qml/v8/qjsvalue.h')
-rw-r--r-- | src/declarative/qml/v8/qjsvalue.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/declarative/qml/v8/qjsvalue.h b/src/declarative/qml/v8/qjsvalue.h index b9278c5d04..f3988d1819 100644 --- a/src/declarative/qml/v8/qjsvalue.h +++ b/src/declarative/qml/v8/qjsvalue.h @@ -142,6 +142,7 @@ public: bool isCallable() const; QJSValue call(const QJSValueList &args); + QJSValue callWithInstance(const QJSValue &instance, const QJSValueList &args = QJSValueList()); QJSValue call(const QJSValue &thisObject = QJSValue(), const QJSValueList &args = QJSValueList()); QJSValue construct(const QJSValueList &args = QJSValueList()); |