aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlprofiler/main.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-05-21 15:39:28 +0200
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-06-06 15:20:33 +0000
commitc402f593595f2705f8d0f73a13a08cb8bbda9421 (patch)
treee2980f3b318b51a98ee0758b2ad1f8383f67fc82 /tools/qmlprofiler/main.cpp
parent8555cdecd66444b07ab09b1644cb42fcb572dd76 (diff)
qmlprofiler: Only accept commands if we ask for them
This way we can shut down the input thread after the last command and we cannot get commands before we can process them. Change-Id: Ie1583a338da9c9df0e07c9e09ce185857c5ea66d Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'tools/qmlprofiler/main.cpp')
-rw-r--r--tools/qmlprofiler/main.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/qmlprofiler/main.cpp b/tools/qmlprofiler/main.cpp
index 2a85b72f1e..5496072eb2 100644
--- a/tools/qmlprofiler/main.cpp
+++ b/tools/qmlprofiler/main.cpp
@@ -41,12 +41,16 @@ int main(int argc, char *argv[])
app.parseArguments();
if (app.isInteractive()) {
+ QThread listenerThread;
CommandListener listener;
+ listener.moveToThread(&listenerThread);
QObject::connect(&listener, SIGNAL(command(QString)), &app, SLOT(userCommand(QString)));
- listener.start();
+ QObject::connect(&app, SIGNAL(readyForCommand()), &listener, SLOT(readCommand()));
+ listenerThread.start();
int exitValue = app.exec();
+ listenerThread.quit();
// wait for listener to exit
- listener.wait();
+ listenerThread.wait();
return exitValue;
} else {
return app.exec();