[mythtv-users] QT programming question

Sascha Vogt FunkyFish at gmx.net
Tue Jan 20 17:18:43 UTC 2009


Hi,

Nasa schrieb:
> Nasa schrieb:
>> I have looked extensively at MythMovies (closest thing to what I am
>> doing).....
>>>I think you missed this one from moviesui.cpp:
>>>if (!proc.waitForStarted())
> 
>>>Just as I said, you have to wait for the started signal!
> 
> 
> Didn't miss that -- it's used to ensure a process is started, not to see
> if it still running.
> 
In your code example, this is missing. So do you actually have a
waitForStarted or not? It's vital, because proc.start() will immediately
return and your proc.state() compare will fail because at that moment
the process is NOT YET running. In fact in this moment it is most likely
in QProcess::Starting state!

> WaitforFinish is the function to block until the process has stopped --
> and no, it doesn't work either...
What do you mean with "doesn't work either". Do you try to compare
proc.state() with QProcess::Running AFTER proc.waitForFinish()??? That
would be perfectly ok, because when waitForFinish returns the process
actually already HAS finished and therefore NOT running anymore. It
would be QProcess::NotRunning in this case!

Greetings
-Sascha-


More information about the mythtv-users mailing list