diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-02-06 19:40:36 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2018-02-06 19:40:36 +0000 |
commit | 81b393227db1f28a3838ea9aa958d5e609fe0cdf (patch) | |
tree | 71bade271de1b7fe451f2cd505145979b9c4e34d /src/qml/debugger | |
parent | f252b5229dc291cbf0773d2252068b0b2a6d7c9e (diff) | |
parent | a9a9fa0c4737017aa4fc72b467eb45645d0912f0 (diff) |
Merge "Merge remote-tracking branch 'origin/5.10' into dev" into refs/staging/dev
Diffstat (limited to 'src/qml/debugger')
-rw-r--r-- | src/qml/debugger/qqmlprofiler_p.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/qml/debugger/qqmlprofiler_p.h b/src/qml/debugger/qqmlprofiler_p.h index 7800b24076..2e87f10302 100644 --- a/src/qml/debugger/qqmlprofiler_p.h +++ b/src/qml/debugger/qqmlprofiler_p.h @@ -298,9 +298,10 @@ public: { // Use the QV4::Function as ID, as that is common among different instances of the same // component. QQmlBinding is per instance. - // Add 1 to the ID, to make it different from the IDs the V4 profiler produces. The +1 makes - // the pointer point into the middle of the QV4::Function. Thus it still points to valid - // memory but we cannot accidentally create a duplicate key from another object. + // Add 1 to the ID, to make it different from the IDs the V4 and signal handling profilers + // produce. The +1 makes the pointer point into the middle of the QV4::Function. Thus it + // still points to valid memory but we cannot accidentally create a duplicate key from + // another object. // If there is no function, use a static but valid address: The profiler itself. quintptr locationId = function ? id(function) + 1 : id(this); m_data.append(QQmlProfilerData(m_timer.nsecsElapsed(), @@ -332,7 +333,12 @@ public: void startHandlingSignal(QQmlBoundSignalExpression *expression) { - quintptr locationId(id(expression)); + // Use the QV4::Function as ID, as that is common among different instances of the same + // component. QQmlBoundSignalExpression is per instance. + // Add 2 to the ID, to make it different from the IDs the V4 and binding profilers produce. + // The +2 makes the pointer point into the middle of the QV4::Function. Thus it still points + // to valid memory but we cannot accidentally create a duplicate key from another object. + quintptr locationId(id(expression->function()) + 2); m_data.append(QQmlProfilerData(m_timer.nsecsElapsed(), (1 << RangeStart | 1 << RangeLocation), HandlingSignal, locationId)); @@ -515,7 +521,12 @@ private: QQmlProfiler *profiler; }; +#endif // QT_NO_QML_DEBUGGER + QT_END_NAMESPACE + +#ifndef QT_NO_QML_DEBUGGER + Q_DECLARE_METATYPE(QVector<QQmlProfilerData>) Q_DECLARE_METATYPE(QQmlProfiler::LocationHash) |