aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@digia.com>2013-12-16 16:19:56 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-21 15:57:46 +0100
commitd5f5b3f87dc376b237c81d150a8d36cbb525e12e (patch)
tree448aa5be35d75dad5a0278d17e609174ac9955a4 /src/qml/qml
parent24c43a5748b850203dd4711de43b92122e0f6cd5 (diff)
Retrieve detailed location information when profiling signal handlers
Use the Functions associated with signal handlers to find out which exact code is being executed. Task-number: QTCREATORBUG-11100 Change-Id: Idfae9d188b17977b55f551e6fe766042fe24e786 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
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; }