aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2018-03-27 15:58:43 +0200
committerUlf Hermann <[email protected]>2018-04-17 09:13:04 +0000
commit1ccd058bdfbd6334dfe09d23ac85b7de0cfa1ff1 (patch)
tree3bf27e06aa47f261985c746ca5d4253b49fd2777 /src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
parent72e0a6fec5f451650dcec242378dfdb850e5df89 (diff)
QmlProfiler: Get rid of processing step
The child models are made aware of possible changes in the details strings, and in turn, we can do the finalization immediately after acquiring is done. Change-Id: Ibe57f158e64e5d01d4c97aa617c9b2bcc8e4e96e Task-number: QTCREATORBUG-20106 Reviewed-by: Tobias Hunger <[email protected]>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp')
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
index 66688fd8082..430493192be 100644
--- a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
@@ -398,6 +398,12 @@ void QmlProfilerStatisticsModel::modelManagerStateChanged()
}
}
+void QmlProfilerStatisticsModel::typeDetailsChanged(int typeIndex)
+{
+ const QModelIndex index = createIndex(typeIndex, MainDetails);
+ emit dataChanged(index, index, QVector<int>({SortRole, Qt::DisplayRole}));
+}
+
void QmlProfilerStatisticsModel::notesChanged(int typeIndex)
{
static const QVector<int> noteRoles({Qt::ToolTipRole, Qt::TextColorRole});
@@ -498,6 +504,8 @@ QmlProfilerStatisticsRelativesModel::QmlProfilerStatisticsRelativesModel(
QTC_CHECK(modelManager);
QTC_CHECK(statisticsModel);
statisticsModel->setRelativesModel(this, relation);
+ connect(m_modelManager, &QmlProfilerModelManager::typeDetailsChanged,
+ this, &QmlProfilerStatisticsRelativesModel::typeDetailsChanged);
}
bool operator<(const QmlProfilerStatisticsRelativesModel::QmlStatisticsRelativesData &a,
@@ -697,6 +705,22 @@ bool QmlProfilerStatisticsRelativesModel::setData(const QModelIndex &index, cons
}
}
+void QmlProfilerStatisticsRelativesModel::typeDetailsChanged(int typeId)
+{
+ auto main_it = m_data.constFind(m_relativeTypeIndex);
+ if (main_it == m_data.constEnd())
+ return;
+
+ const QVector<QmlStatisticsRelativesData> &rows = main_it.value();
+ for (int row = 0, end = rows.length(); row != end; ++row) {
+ if (rows[row].typeIndex == typeId) {
+ const QModelIndex index = createIndex(row, RelativeDetails);
+ emit dataChanged(index, index, QVector<int>({SortRole, Qt::DisplayRole}));
+ return;
+ }
+ }
+}
+
void QmlProfilerStatisticsRelativesModel::clear()
{
beginResetModel();