QmlProfiler: Move parts of model manager and trace file to Timeline

This way we can use the trace file loading and saving mechanism for
other profilers.

Change-Id: I98ec1cdde6f7abcea152cabf72e64d4e696dfa59
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Ulf Hermann
2018-04-05 09:47:33 +02:00
parent 7099f21586
commit 1c2e0f387f
37 changed files with 1443 additions and 1001 deletions

View File

@@ -36,8 +36,11 @@ MemoryUsageModel::MemoryUsageModel(QmlProfilerModelManager *manager,
Timeline::TimelineModelAggregator *parent) :
QmlProfilerTimelineModel(manager, MemoryAllocation, MaximumRangeType, ProfileMemory, parent)
{
// Announce additional features. The base class already announces the main feature.
announceFeatures(Constants::QML_JS_RANGE_FEATURES ^ (1 << ProfileCompiling));
// Register additional features. The base class already registers the main feature.
// Don't register initializer, finalizer, or clearer as the base class has done so already.
modelManager()->registerFeatures(Constants::QML_JS_RANGE_FEATURES ^ (1 << ProfileCompiling),
std::bind(&QmlProfilerTimelineModel::loadEvent, this,
std::placeholders::_1, std::placeholders::_2));
}
qint64 MemoryUsageModel::rowMaxValue(int rowNumber) const
@@ -246,6 +249,7 @@ void MemoryUsageModel::finalize()
computeNesting();
setExpandedRowCount(3);
setCollapsedRowCount(3);
QmlProfilerTimelineModel::finalize();
}
void MemoryUsageModel::clear()