aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2019-04-12 14:31:01 +0200
committerEike Ziller <eike.ziller@qt.io>2019-04-12 14:31:01 +0200
commit75696f96390ca6f818aa7fd13c1104a6eed6089b (patch)
tree739057c8e3e8b8c45854e1f6950d2fb9eabe0bd1 /src/plugins/qmlprofiler
parent131ce54bee415934173be7369ec74e5899b355c1 (diff)
parent07a5c196c42579538e458990454a657e03e618fb (diff)
Merge remote-tracking branch 'origin/4.9'
Diffstat (limited to 'src/plugins/qmlprofiler')
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerstatisticsview.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilerstatisticsview.cpp b/src/plugins/qmlprofiler/qmlprofilerstatisticsview.cpp
index 4bbf8d2c440..d11c97e0854 100644
--- a/src/plugins/qmlprofiler/qmlprofilerstatisticsview.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerstatisticsview.cpp
@@ -298,13 +298,15 @@ void QmlProfilerStatisticsMainView::displayTypeIndex(int typeIndex)
QAbstractItemModel *sourceModel = sortModel->sourceModel();
QTC_ASSERT(sourceModel, return);
- QModelIndex sourceIndex = sourceModel->index(qMin(typeIndex, sourceModel->rowCount() - 1),
- MainCallCount);
- QTC_ASSERT(sourceIndex.data(TypeIdRole).toInt() == typeIndex, return);
-
- setCurrentIndex(sourceIndex.data(SortRole).toInt() > 0
- ? sortModel->mapFromSource(sourceIndex)
- : QModelIndex());
+ if (typeIndex < sourceModel->rowCount()) {
+ QModelIndex sourceIndex = sourceModel->index(typeIndex, MainCallCount);
+ QTC_ASSERT(sourceIndex.data(TypeIdRole).toInt() == typeIndex, return);
+ setCurrentIndex(sourceIndex.data(SortRole).toInt() > 0
+ ? sortModel->mapFromSource(sourceIndex)
+ : QModelIndex());
+ } else {
+ setCurrentIndex(QModelIndex());
+ }
}
// show in callers/callees subwindow