From aee9cde1602d8360685b0ea60bd69cce24f7e18a Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 30 May 2018 12:49:47 +0200 Subject: [PATCH] QmlProfiler: In statistics view use source model for location lookup The sorted model's rows are not equivalent to typeIDs. Change-Id: I88868e192079f61bd1d336dac98142fd415d9a4a Task-number: QTCREATORBUG-20501 Reviewed-by: Christian Kandeler --- src/plugins/qmlprofiler/qmlprofilerstatisticsview.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmlprofiler/qmlprofilerstatisticsview.cpp b/src/plugins/qmlprofiler/qmlprofilerstatisticsview.cpp index ffc92a37a01..91881d79d08 100644 --- a/src/plugins/qmlprofiler/qmlprofilerstatisticsview.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerstatisticsview.cpp @@ -274,8 +274,14 @@ void QmlProfilerStatisticsMainView::jumpToItem(int typeIndex) { displayTypeIndex(typeIndex); + QSortFilterProxyModel *sortModel = qobject_cast(model()); + QTC_ASSERT(sortModel, return); + + QAbstractItemModel *sourceModel = sortModel->sourceModel(); + QTC_ASSERT(sourceModel, return); + // show in editor - getSourceLocation(model()->index(typeIndex, MainLocation), + getSourceLocation(sourceModel->index(typeIndex, MainLocation), [this](const QString &fileName, int line, int column) { emit gotoSourceLocation(fileName, line, column); });