aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlprofiler
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-05-21 15:37:52 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-06-07 08:26:19 +0000
commit6247e30afb0ee972f553f3905d893d2d586c6252 (patch)
treee65f8cd5f1cfcc949872eeba3ce69636369c51d1 /tools/qmlprofiler
parentaa68eab142c5e2106ab0c5e3a4bde6adfa550328 (diff)
qmlprofiler: Output data after application quits in non-interactive mode
Change-Id: I38abed0d5af3bcc7be5fa9e21bde14be40a3ce1d Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'tools/qmlprofiler')
-rw-r--r--tools/qmlprofiler/main.cpp4
-rw-r--r--tools/qmlprofiler/qmlprofilerapplication.cpp8
-rw-r--r--tools/qmlprofiler/qmlprofilerapplication.h1
3 files changed, 12 insertions, 1 deletions
diff --git a/tools/qmlprofiler/main.cpp b/tools/qmlprofiler/main.cpp
index 5496072eb2..12fcc79efa 100644
--- a/tools/qmlprofiler/main.cpp
+++ b/tools/qmlprofiler/main.cpp
@@ -53,6 +53,8 @@ int main(int argc, char *argv[])
listenerThread.wait();
return exitValue;
} else {
- return app.exec();
+ int exitValue = app.exec();
+ app.outputData();
+ return exitValue;
}
}
diff --git a/tools/qmlprofiler/qmlprofilerapplication.cpp b/tools/qmlprofiler/qmlprofilerapplication.cpp
index a9fa691cbc..1b3a90a1a1 100644
--- a/tools/qmlprofiler/qmlprofilerapplication.cpp
+++ b/tools/qmlprofiler/qmlprofilerapplication.cpp
@@ -394,6 +394,14 @@ void QmlProfilerApplication::notifyTraceStarted()
}
}
+void QmlProfilerApplication::outputData()
+{
+ if (!m_profilerData.isEmpty()) {
+ m_profilerData.save(m_outputFile);
+ m_profilerData.clear();
+ }
+}
+
void QmlProfilerApplication::run()
{
if (m_runMode == LaunchMode) {
diff --git a/tools/qmlprofiler/qmlprofilerapplication.h b/tools/qmlprofiler/qmlprofilerapplication.h
index 8f5be179b6..183bb9d644 100644
--- a/tools/qmlprofiler/qmlprofilerapplication.h
+++ b/tools/qmlprofiler/qmlprofilerapplication.h
@@ -67,6 +67,7 @@ signals:
public slots:
void userCommand(const QString &command);
void notifyTraceStarted();
+ void outputData();
private slots:
void run();