I am deploying a Qt application from a USB drive on windows. The application takes a while to cold start (~10s). I want to display some splash screens to keep the user patient while it loads.
I first tried putting the splash screens in the main thread, they did not appear for ~10s. Whatever library is being cached must be still loading before the splash screens appear.
I then tried to move splash screens to another process and start it using QProcess::start()
. Once again there is a ~10s delay and then both my application and the splash screens are appearing simultaneously.
Finally I tried making a splash screen process launch my primary application using QProcess::start()
. In this case the splash screens appear well before the primary application as desired, but the trouble is I would like two things 1) the primary application to outlive the splash screens, 2) the primary application to inform the splash screens that it is done loading via stdout and QProcess:readAllStandardOutput() so the splash screen can kill itself.
It seems that this is not possible with QProcess::start
, QProcess::execute
, and QProcess::startDetached
. When using startDetached
QProcess::readAllStandardOutput()
won't work because QProcess::startDetached
is static.
When using QProcess::start
and QProcess::execute
my main application should not outlive the splashscreens, which oddly enough is not the case and I have posted a separate question asking why that might be (Attached child QProcess outliving parent). Since the documentation leads me to believe this should not happen I do not want to rely on this behavior.
Does anyone know how I can safely start a QProcess that outlives its parent AND can communicate with it?