diff options
Diffstat (limited to 'tools/qmlprofiler/main.cpp')
-rw-r--r-- | tools/qmlprofiler/main.cpp | 8 |
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(); |