aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/v8/qjsvalue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml/v8/qjsvalue.cpp')
-rw-r--r--src/declarative/qml/v8/qjsvalue.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/declarative/qml/v8/qjsvalue.cpp b/src/declarative/qml/v8/qjsvalue.cpp
index 482216ac49..a43dd33f14 100644
--- a/src/declarative/qml/v8/qjsvalue.cpp
+++ b/src/declarative/qml/v8/qjsvalue.cpp
@@ -71,7 +71,7 @@
Object values have an internal \c{prototype} property, which can be
accessed with prototype() and setPrototype().
- Function objects (objects for which isFunction() returns true) can
+ Function objects (objects for which isCallable()) returns true) can
be invoked by calling call(). Constructor functions can be used to
construct new objects by calling construct().
@@ -461,11 +461,23 @@ bool QJSValue::isObject() const
}
/*!
- Returns true if this QJSValue is a function; otherwise returns
- false.
+ Returns true if this QJSValue can be called a function, otherwise
+ returns false.
\sa call()
*/
+bool QJSValue::isCallable() const
+{
+ Q_D(const QJSValue);
+ QScriptIsolate api(d->engine());
+ return d->isCallable();
+}
+
+/*!
+ \obsolete
+
+ Use isCallable() instead.
+*/
bool QJSValue::isFunction() const
{
Q_D(const QJSValue);