diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp index 067af444b4d..e19df2893ea 100644 --- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp @@ -443,6 +443,9 @@ void QmlProfilerModelManager::clear() void QmlProfilerModelManager::restrictToRange(qint64 startTime, qint64 endTime) { d->notesModel->saveData(); + const QVector notes = d->notesModel->notes(); + d->notesModel->clear(); + setState(ClearingData); setVisibleFeatures(0); @@ -450,7 +453,7 @@ void QmlProfilerModelManager::restrictToRange(qint64 startTime, qint64 endTime) d->model->replayEvents(startTime, endTime, std::bind(&QmlProfilerModelManager::dispatch, this, std::placeholders::_1, std::placeholders::_2)); - d->notesModel->loadData(); + d->notesModel->setNotes(notes); d->traceTime->restrictToRange(startTime, endTime); acquiringDone(); } diff --git a/src/plugins/qmlprofiler/qmlprofilernotesmodel.cpp b/src/plugins/qmlprofiler/qmlprofilernotesmodel.cpp index e559884f45b..b59a942ffbb 100644 --- a/src/plugins/qmlprofiler/qmlprofilernotesmodel.cpp +++ b/src/plugins/qmlprofiler/qmlprofilernotesmodel.cpp @@ -87,7 +87,6 @@ int QmlProfilerNotesModel::addQmlNote(int typeId, int collapsedRow, qint64 start void QmlProfilerNotesModel::loadData() { blockSignals(true); - TimelineNotesModel::clear(); for (int i = 0; i != m_notes.size(); ++i) { QmlNote ¬e = m_notes[i]; note.setLoaded(addQmlNote(note.typeIndex(), note.collapsedRow(), note.startTime(),