forked from qt-creator/qt-creator
QmlProfiler: Add text marks for QML/JS types into documents
The text marks are little labels next to the lines in the editor that tell you how much of total run time was spent in the respective QML/JS construct during the last profiling session. This is similar to what the valgrind profiler does. We add the text marks only when the documents are loaded into an editor. This keeps the number of text marks manageable. Multiple events on a single line are shown using a tooltip. Task-number: QTCREATORBUG-17757 Change-Id: Ie38b8ab880a718a1ef72ef343d84070ab34bc5bc Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -188,15 +188,14 @@ void QmlProfilerDataModel::QmlProfilerDataModelPrivate::rewriteType(int typeInde
|
||||
type.setDisplayName(getDisplayName(type));
|
||||
type.setData(getInitialDetails(type));
|
||||
|
||||
// Only bindings and signal handlers need rewriting
|
||||
if (type.rangeType() != Binding && type.rangeType() != HandlingSignal)
|
||||
return;
|
||||
|
||||
const QmlEventLocation &location = type.location();
|
||||
// There is no point in looking for invalid locations
|
||||
if (!type.location().isValid())
|
||||
if (!location.isValid())
|
||||
return;
|
||||
|
||||
detailsRewriter->requestDetailsForLocation(typeIndex, type.location());
|
||||
// Only bindings and signal handlers need rewriting
|
||||
if (type.rangeType() == Binding || type.rangeType() == HandlingSignal)
|
||||
detailsRewriter->requestDetailsForLocation(typeIndex, location);
|
||||
}
|
||||
|
||||
static bool isStateful(const QmlEventType &type)
|
||||
|
||||
Reference in New Issue
Block a user