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 <kai.koehne@qt.io>
This commit is contained in:
Ulf Hermann
2016-09-09 10:34:39 +02:00
parent fbb45e5a57
commit 257d1990c6
2 changed files with 9 additions and 0 deletions

View File

@@ -258,6 +258,14 @@ void MemoryUsageModel::clear()
QmlProfilerTimelineModel::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) : MemoryUsageModel::MemoryAllocationItem::MemoryAllocationItem(int typeId, qint64 baseAmount) :
size(baseAmount), allocated(0), deallocated(0), allocations(0), deallocations(0), size(baseAmount), allocated(0), deallocated(0), allocations(0), deallocations(0),
typeId(typeId) typeId(typeId)

View File

@@ -71,6 +71,7 @@ public:
void loadEvent(const QmlEvent &event, const QmlEventType &type) override; void loadEvent(const QmlEvent &event, const QmlEventType &type) override;
void finalize() override; void finalize() override;
void clear() override; void clear() override;
bool handlesTypeId(int typeId) const override;
private: private:
struct RangeStackFrame { struct RangeStackFrame {