diff --git a/src/plugins/qmlprofiler/qml/MainView.qml b/src/plugins/qmlprofiler/qml/MainView.qml index 6aa0719966975ba70dc2d7c98caf402f807d0ef8..9fc2e8e44ed67693679d762627f0f4c92cc3cac0 100644 --- a/src/plugins/qmlprofiler/qml/MainView.qml +++ b/src/plugins/qmlprofiler/qml/MainView.qml @@ -77,6 +77,8 @@ Rectangle { signal changeToolTip(string text) signal updateVerticalScroll(int newPosition) + property bool applicationDied : false + // ***** connections with external objects Connections { target: zoomControl @@ -149,6 +151,7 @@ Rectangle { function clearData() { view.clearData(); dataAvailable = false; + applicationDied = false; eventCount = 0; hideRangeDetails(); selectionRangeMode = false; diff --git a/src/plugins/qmlprofiler/qml/StatusDisplay.qml b/src/plugins/qmlprofiler/qml/StatusDisplay.qml index f02aec121e96d8bdadd2f99bb673ac033604683c..d4507a37d63c7941e907909e8044675df3303f91 100644 --- a/src/plugins/qmlprofiler/qml/StatusDisplay.qml +++ b/src/plugins/qmlprofiler/qml/StatusDisplay.qml @@ -99,7 +99,7 @@ Item { // loading data State { name: "loading" - when: (!root.dataAvailable) && (root.eventCount > 0) + when: (!root.dataAvailable) && (root.eventCount > 0) && !root.applicationDied PropertyChanges { target: statusDisplay visible: true @@ -110,6 +110,23 @@ Item { text: qsTr("Loading data") } + PropertyChanges { + target: progressBar + visible: true + } + }, + // application died + State { + name: "deadApp" + when: (!root.dataAvailable) && (root.eventCount > 0) && root.applicationDied + PropertyChanges { + target: statusDisplay + visible: true + } + PropertyChanges { + target: statusText + text: qsTr("Application stopped before loading all data") + } PropertyChanges { target: progressBar visible: true diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.cpp b/src/plugins/qmlprofiler/qmlprofilerengine.cpp index 6a835ac52aae8e4a950ac13fecca4c67a902085d..b6bc249a4762698e748c8b4c97489aa64d26bf0c 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerengine.cpp @@ -80,6 +80,7 @@ public: AbstractQmlProfilerRunner *m_runner; bool m_running; bool m_fetchingData; + bool m_hasData; bool m_fetchDataFromStart; bool m_delayedDelete; QTimer m_noDebugOutputTimer; @@ -209,6 +210,7 @@ bool QmlProfilerEngine::start() if (d->m_fetchDataFromStart) { d->m_fetchingData = true; + d->m_hasData = false; } emit starting(this); @@ -236,8 +238,9 @@ void QmlProfilerEngine::stopped() d->m_fetchDataFromStart = d->m_fetchingData; // user feedback - if (d->m_running && d->m_fetchingData) { + if (d->m_running && d->m_fetchingData && !d->m_hasData) { showNonmodalWarning(tr("Application finished before loading profiled data.\n Please use the stop button instead.")); + emit applicationDied(); } d->m_running = false; @@ -250,6 +253,8 @@ void QmlProfilerEngine::stopped() void QmlProfilerEngine::setFetchingData(bool b) { d->m_fetchingData = b; + if (d->m_running && b) + d->m_hasData = false; if (!d->m_running) d->m_fetchDataFromStart = b; } @@ -259,6 +264,7 @@ void QmlProfilerEngine::dataReceived() if (d->m_delayedDelete) finishProcess(); d->m_delayedDelete = false; + d->m_hasData = true; } void QmlProfilerEngine::finishProcess() diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.h b/src/plugins/qmlprofiler/qmlprofilerengine.h index 017ffd050ba0ddb6ec7de1979e87b1f0d38db3db..9969d2a3a7f178a29564dc7c5c54f993883ee740 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.h +++ b/src/plugins/qmlprofiler/qmlprofilerengine.h @@ -55,6 +55,7 @@ signals: void stopRecording(); void timeUpdate(); void recordingChanged(bool recording); + void applicationDied(); public slots: bool start(); diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 6d8c5979d77dda563a5bf8c7c4b6c1fcf69ee0d8..82dce53529669e990586642a7c4f202d4eb00d1f 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -376,6 +376,7 @@ IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp connect(engine, SIGNAL(starting(const Analyzer::IAnalyzerEngine*)), this, SLOT(setAppIsRunning())); connect(engine, SIGNAL(finished()), this, SLOT(setAppIsStopped())); connect(this, SIGNAL(cancelRun()), engine, SLOT(finishProcess())); + connect(engine, SIGNAL(applicationDied()), d->m_traceWindow, SLOT(applicationDied())); emit fetchingData(d->m_recordButton->isChecked()); return engine; diff --git a/src/plugins/qmlprofiler/tracewindow.cpp b/src/plugins/qmlprofiler/tracewindow.cpp index 2c35537801dfbede6b010531dac84e4d86a0ad9e..6a4f3817fb4bbac5b0e3fba0946954ef25102abb 100644 --- a/src/plugins/qmlprofiler/tracewindow.cpp +++ b/src/plugins/qmlprofiler/tracewindow.cpp @@ -639,5 +639,11 @@ void TraceWindow::firstDataReceived() } } +void TraceWindow::applicationDied() +{ + if (m_mainView->rootObject()) + m_mainView->rootObject()->setProperty("applicationDied",QVariant(true)); +} + } // namespace Internal } // namespace QmlProfiler diff --git a/src/plugins/qmlprofiler/tracewindow.h b/src/plugins/qmlprofiler/tracewindow.h index df2d3fe27f434e5cf3d03863341ed6708e5fba35..85acd2ad687709520c38dd854658c80087c68c7b 100644 --- a/src/plugins/qmlprofiler/tracewindow.h +++ b/src/plugins/qmlprofiler/tracewindow.h @@ -133,6 +133,7 @@ private slots: void eventListStateChanged(); void manageTraceStart(qint64 traceStart); void firstDataReceived(); + void applicationDied(); void correctTimer(); signals: