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 <christian.kandeler@qt.io>
This commit is contained in:
Ulf Hermann
2018-05-30 12:49:47 +02:00
parent 4b0a4c1660
commit aee9cde160

View File

@@ -274,8 +274,14 @@ void QmlProfilerStatisticsMainView::jumpToItem(int typeIndex)
{
displayTypeIndex(typeIndex);
QSortFilterProxyModel *sortModel = qobject_cast<QSortFilterProxyModel *>(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);
});