aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml')
-rw-r--r--src/qml/qml/qqmlboundsignal.cpp11
-rw-r--r--src/qml/qml/qqmlboundsignal_p.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlboundsignal.cpp b/src/qml/qml/qqmlboundsignal.cpp
index 68160edf5e..bc56fe1f2d 100644
--- a/src/qml/qml/qqmlboundsignal.cpp
+++ b/src/qml/qml/qqmlboundsignal.cpp
@@ -136,6 +136,17 @@ QString QQmlBoundSignalExpression::expression() const
}
}
+QV4::Function *QQmlBoundSignalExpression::function() const
+{
+ if (m_expressionFunctionValid) {
+ Q_ASSERT (context() && engine());
+ QV4::Scope scope(QQmlEnginePrivate::get(engine())->v4engine());
+ QV4::Scoped<QV4::FunctionObject> v(scope, m_v8function.value());
+ return v ? v->function : 0;
+ }
+ return 0;
+}
+
// Parts of this function mirror code in QQmlExpressionPrivate::value() and v8value().
// Changes made here may need to be made there and vice versa.
void QQmlBoundSignalExpression::evaluate(void **a)
diff --git a/src/qml/qml/qqmlboundsignal_p.h b/src/qml/qml/qqmlboundsignal_p.h
index feb79d5484..fe0dbd380e 100644
--- a/src/qml/qml/qqmlboundsignal_p.h
+++ b/src/qml/qml/qqmlboundsignal_p.h
@@ -90,6 +90,7 @@ public:
quint16 lineNumber() const { return m_line; }
quint16 columnNumber() const { return m_column; }
QString expression() const;
+ QV4::Function *function() const;
QObject *target() const { return m_target; }
QQmlEngine *engine() const { return context() ? context()->engine : 0; }