From 257d1990c6617bc0a06a552451f30dbec52df846 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 9 Sep 2016 10:34:39 +0200 Subject: [PATCH] QmlProfiler: Don't handle type IDs in memory usage model Events in the memory usage model should not be selected when a type ID is propagated from the statistics or flame graph model. The event in the respective QML/JS model should rather be selected. Change-Id: I6646358650f61c424c607e9dd8edb7fd9a61597e Reviewed-by: Kai Koehne --- src/plugins/qmlprofiler/memoryusagemodel.cpp | 8 ++++++++ src/plugins/qmlprofiler/memoryusagemodel.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/plugins/qmlprofiler/memoryusagemodel.cpp b/src/plugins/qmlprofiler/memoryusagemodel.cpp index b0541fa7d00..939e95614e1 100644 --- a/src/plugins/qmlprofiler/memoryusagemodel.cpp +++ b/src/plugins/qmlprofiler/memoryusagemodel.cpp @@ -258,6 +258,14 @@ void MemoryUsageModel::clear() QmlProfilerTimelineModel::clear(); } +bool MemoryUsageModel::handlesTypeId(int typeId) const +{ + Q_UNUSED(typeId); + // We don't want the memory ranges allocated by some QML/JS function to be highlighted when + // propagating a typeId selection to the timeline. The actual range should be highlighted. + return false; +} + MemoryUsageModel::MemoryAllocationItem::MemoryAllocationItem(int typeId, qint64 baseAmount) : size(baseAmount), allocated(0), deallocated(0), allocations(0), deallocations(0), typeId(typeId) diff --git a/src/plugins/qmlprofiler/memoryusagemodel.h b/src/plugins/qmlprofiler/memoryusagemodel.h index 948395dfaf5..dd978da788a 100644 --- a/src/plugins/qmlprofiler/memoryusagemodel.h +++ b/src/plugins/qmlprofiler/memoryusagemodel.h @@ -71,6 +71,7 @@ public: void loadEvent(const QmlEvent &event, const QmlEventType &type) override; void finalize() override; void clear() override; + bool handlesTypeId(int typeId) const override; private: struct RangeStackFrame {