diff --git a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp index c7cd5009ed7..804d68e5e2d 100644 --- a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp @@ -140,7 +140,7 @@ void QmlProfilerStatisticsModel::clear() void QmlProfilerStatisticsModel::setRelativesModel(QmlProfilerStatisticsRelativesModel *relative, QmlProfilerStatisticsRelation relation) { - if (relation == QmlProfilerStatisticsParents) + if (relation == QmlProfilerStatisticsCallers) m_callersModel = relative; else m_calleesModel = relative; @@ -311,11 +311,11 @@ void QmlProfilerStatisticsRelativesModel::loadEvent(RangeType type, const QmlEve stack.push({event.timestamp(), event.typeIndex()}); break; case RangeEnd: { - int parentTypeIndex = stack.count() > 1 ? stack[stack.count() - 2].typeId : -1; - int relativeTypeIndex = (m_relation == QmlProfilerStatisticsParents) ? parentTypeIndex : + int callerTypeIndex = stack.count() > 1 ? stack[stack.count() - 2].typeId : -1; + int relativeTypeIndex = (m_relation == QmlProfilerStatisticsCallers) ? callerTypeIndex : event.typeIndex(); - int selfTypeIndex = (m_relation == QmlProfilerStatisticsParents) ? event.typeIndex() : - parentTypeIndex; + int selfTypeIndex = (m_relation == QmlProfilerStatisticsCallers) ? event.typeIndex() : + callerTypeIndex; QmlStatisticsRelativesMap &relativesMap = m_data[selfTypeIndex]; QmlStatisticsRelativesMap::Iterator it = relativesMap.find(relativeTypeIndex); diff --git a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.h b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.h index 2c2bac88f6e..478207255ad 100644 --- a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.h +++ b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.h @@ -41,8 +41,8 @@ class QmlProfilerModelManager; class QmlProfilerStatisticsRelativesModel; enum QmlProfilerStatisticsRelation { - QmlProfilerStatisticsChilden, - QmlProfilerStatisticsParents + QmlProfilerStatisticsCallees, + QmlProfilerStatisticsCallers }; class QmlProfilerStatisticsModel : public QObject diff --git a/src/plugins/qmlprofiler/qmlprofilerstatisticsview.cpp b/src/plugins/qmlprofiler/qmlprofilerstatisticsview.cpp index 97f970de072..d3d45cb7fa0 100644 --- a/src/plugins/qmlprofiler/qmlprofilerstatisticsview.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerstatisticsview.cpp @@ -153,7 +153,7 @@ static QString displayHeader(RelativeField header, QmlProfilerStatisticsRelation { switch (header) { case RelativeLocation: - return relation == QmlProfilerStatisticsChilden + return relation == QmlProfilerStatisticsCallees ? QmlProfilerStatisticsMainView::tr("Callee") : QmlProfilerStatisticsMainView::tr("Caller"); case RelativeType: @@ -163,7 +163,7 @@ static QString displayHeader(RelativeField header, QmlProfilerStatisticsRelation case RelativeCallCount: return displayHeader(MainCallCount); case RelativeDetails: - return relation == QmlProfilerStatisticsChilden + return relation == QmlProfilerStatisticsCallees ? QmlProfilerStatisticsMainView::tr("Callee Description") : QmlProfilerStatisticsMainView::tr("Caller Description"); case MaxRelativeField: @@ -198,10 +198,10 @@ QmlProfilerStatisticsView::QmlProfilerStatisticsView(QmlProfilerModelManager *pr m_calleesView.reset(new QmlProfilerStatisticsRelativesView( new QmlProfilerStatisticsRelativesModel(profilerModelManager, model, - QmlProfilerStatisticsChilden))); + QmlProfilerStatisticsCallees))); m_callersView.reset(new QmlProfilerStatisticsRelativesView( new QmlProfilerStatisticsRelativesModel(profilerModelManager, model, - QmlProfilerStatisticsParents))); + QmlProfilerStatisticsCallers))); connect(m_mainView.get(), &QmlProfilerStatisticsMainView::typeSelected, m_calleesView.get(), &QmlProfilerStatisticsRelativesView::displayType); connect(m_mainView.get(), &QmlProfilerStatisticsMainView::typeSelected, @@ -457,16 +457,16 @@ void QmlProfilerStatisticsMainView::updateNotes(int typeIndex) { const QHash &eventList = m_model->getData(); const QHash ¬eList = m_model->getNotes(); - QStandardItem *parentItem = m_standardItemModel->invisibleRootItem(); + QStandardItem *rootItem = m_standardItemModel->invisibleRootItem(); - for (int rowIndex = 0; rowIndex < parentItem->rowCount(); ++rowIndex) { - int rowType = parentItem->child(rowIndex)->data(TypeIdRole).toInt(); + for (int rowIndex = 0; rowIndex < rootItem->rowCount(); ++rowIndex) { + int rowType = rootItem->child(rowIndex)->data(TypeIdRole).toInt(); if (rowType != typeIndex && typeIndex != -1) continue; const QmlProfilerStatisticsModel::QmlEventStats &stats = eventList[rowType]; - for (int columnIndex = 0; columnIndex < parentItem->columnCount(); ++columnIndex) { - QStandardItem *item = parentItem->child(rowIndex, columnIndex); + for (int columnIndex = 0; columnIndex < rootItem->columnCount(); ++columnIndex) { + QStandardItem *item = rootItem->child(rowIndex, columnIndex); QHash::ConstIterator it = noteList.find(rowType); if (it != noteList.end()) { item->setBackground(colors()->noteBackground); @@ -513,7 +513,7 @@ void QmlProfilerStatisticsMainView::parseModel() int typeIndex = it.key(); const QmlProfilerStatisticsModel::QmlEventStats &stats = it.value(); const QmlEventType &type = (typeIndex != -1 ? typeList[typeIndex] : *rootEventType()); - QStandardItem *parentItem = m_standardItemModel->invisibleRootItem(); + QStandardItem *rootItem = m_standardItemModel->invisibleRootItem(); QList newRow; newRow << new StatisticsViewItem( @@ -569,7 +569,7 @@ void QmlProfilerStatisticsMainView::parseModel() first->setData(location.column(), ColumnRole); // append - parentItem->appendRow(newRow); + rootItem->appendRow(newRow); } }