I have a launcher application which will fork
and exec
a Qt application when the user clicks on the relevant icon.
For visual feedback, I want to display a wait cursor from the time when the user selects an icon, until the requested app's main window is on-screen.
void RocketLauncher::onItemSelect(QListWidgetItem* item)
{
QApplication::setOverrideCursor(Qt::WaitCursor);
const AppConfig& app = getAppConfig(item);
forkAndExec(app.cwd(), app.cmd(), app.args(), app.env());
// TODO: wait until app's main window is being displayed
QApplication::restoreOverrideCursor();
}
The problem that I'm having is that in my launcher app, I get back the child process's pid from fork
immediately, but it still takes some time for the child process to exec
and for its main window to show up on-screen.
As such, my call to QApplication::restoreOverrideCursor()
executes immediately, and there is no visual cue to the user that the application is still being launched.
Is there some way I can get signalled that the child is running?