Commit 60ead888 authored by Ulf Hermann's avatar Ulf Hermann
Browse files

QmlProfiler: Don't create widgets in a worker thread



We better call QmlProfilerModelManager::complete() from the main
thread. There are too many things that can break if it's called from a
worker thread.

Change-Id: I92211df7ec072d572ed82dc1203efd2f67b4b540
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
parent fba00774
......@@ -351,6 +351,7 @@ void QmlProfilerModelManager::complete()
// Load notes after the timeline models have been initialized.
d->notesModel->loadData();
setState(QmlProfilerDataState::Done);
emit loadFinished();
break;
case QmlProfilerDataState::AcquiringData:
// Make sure the trace fits into the time span.
......@@ -431,9 +432,9 @@ void QmlProfilerModelManager::load()
file->close();
file->deleteLater();
// The completion step uses the old progress display widget for now.
complete();
QMetaObject::invokeMethod(this, "loadFinished", Qt::QueuedConnection);
// The completion step uses the old progress display widget for now. We need to do this in
// the main thread as it creates widgets.
QMetaObject::invokeMethod(this, "complete", Qt::QueuedConnection);
});
Core::ProgressManager::addTask(result, tr("Loading Trace Data"), Constants::TASK_LOAD);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment