aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlprofiler/main.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-05-19 15:54:16 +0200
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-05-21 12:54:48 +0000
commit864b1c498c4257e8790ad8fe13c52c5b06c6a1ac (patch)
treeb8fdb34db30a73549a9c979754208850df9cb5eb /tools/qmlprofiler/main.cpp
parent455e9153eb13399b1b1b711075d77b699aabfbef (diff)
qmlprofiler: Add non-interactive mode and make it the default.
If you just run a test application through the profiler without any further parameters, you want it to record the data the application generates and then terminate itself. [ChangeLog][QtQml][Behavior Change] Make qmlprofiler command line interface better suited for scripting. Task-number: QTBUG-43066 Change-Id: I831e714b9c7b4b984b6450ad5c78ba4fdae6b8f6 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'tools/qmlprofiler/main.cpp')
-rw-r--r--tools/qmlprofiler/main.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/tools/qmlprofiler/main.cpp b/tools/qmlprofiler/main.cpp
index b16706c3a9..2a85b72f1e 100644
--- a/tools/qmlprofiler/main.cpp
+++ b/tools/qmlprofiler/main.cpp
@@ -40,13 +40,15 @@ int main(int argc, char *argv[])
app.parseArguments();
- CommandListener listener;
- QObject::connect(&listener, SIGNAL(command(QString)), &app, SLOT(userCommand(QString)));
- listener.start();
-
- int exitValue = app.exec();
- // wait for listener to exit
- listener.wait();
-
- return exitValue;
+ if (app.isInteractive()) {
+ CommandListener listener;
+ QObject::connect(&listener, SIGNAL(command(QString)), &app, SLOT(userCommand(QString)));
+ listener.start();
+ int exitValue = app.exec();
+ // wait for listener to exit
+ listener.wait();
+ return exitValue;
+ } else {
+ return app.exec();
+ }
}