From 730997b2d800a77ab67034157ecda3d6c777a903 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 7 Jul 2014 11:56:39 +0200 Subject: [PATCH] QmlProfiler: Document restrictions of SortedTimelineModel SortedTimelineModel only works with perfectly nested ranges. Specify what that means so that we don't stumble over it for the (n+1)th time. Change-Id: I77f276ba9152fb023d875d0f326e7d646945d3a7 Reviewed-by: Kai Koehne --- src/plugins/qmlprofiler/sortedtimelinemodel.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmlprofiler/sortedtimelinemodel.cpp b/src/plugins/qmlprofiler/sortedtimelinemodel.cpp index ae8f8e7641d..9453b636946 100644 --- a/src/plugins/qmlprofiler/sortedtimelinemodel.cpp +++ b/src/plugins/qmlprofiler/sortedtimelinemodel.cpp @@ -31,8 +31,14 @@ \class QmlProfiler::SortedTimelineModel \brief Sorted model for timeline data - The SortedTimelineModel lets you keep any kind of range data sorted by - both start and end times, so that visible ranges can easily be computed. + The SortedTimelineModel lets you keep range data sorted by both start and end times, so that + visible ranges can easily be computed. The only precondition for that to work is that the ranges + must be perfectly nested. A "parent" range of a range R is defined as a range for which the + start time is smaller than R's start time and the end time is greater than R's end time. A set + of ranges is perfectly nested if all parent ranges of any given range have a common parent + range. Mind that you can always make that happen by defining a range that spans the whole + available time span. That, however, will make any code that uses firstStartTime() and + lastEndTime() for selecting subsets of the model always select all of it. */ /*!