From f9a3ac7f08b183044a04251fdda2cef1a344cc67 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 15 Jan 2018 10:35:17 +0100 Subject: [PATCH] QmlProfiler: Also handle RunControl::finished() signal If you force-stop an application by closing the output tab, we don't get a stopped() signal. In order to properly reset the UI we need to handle the finished() signal then. Change-Id: Ibab5faf86542a59c3eb3aa139bb3dc66afe89ce2 Reviewed-by: hjk Reviewed-by: Christian Kandeler --- src/plugins/qmlprofiler/qmlprofilertool.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 9cfc21d6a76..c27303b433a 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -373,10 +373,16 @@ void QmlProfilerTool::finalizeRunControl(QmlProfilerRunner *runWorker) } } - connect(runControl, &RunControl::stopped, this, [this, runControl] { + auto handleStop = [this, runControl]() { d->m_toolBusy = false; updateRunActions(); disconnect(d->m_stopAction, &QAction::triggered, runControl, &RunControl::initiateStop); + }; + + connect(runControl, &RunControl::stopped, this, handleStop); + connect(runControl, &RunControl::finished, this, [this, runControl, handleStop] { + if (d->m_toolBusy) + handleStop(); }); connect(d->m_stopAction, &QAction::triggered, runControl, &RunControl::initiateStop);