PDA

View Full Version : ask: how to start app within app



rian191
23rd February 2008, 07:24
Hi...all

please advice , I need to start a qt application from another qt application..as far as I know(correct me if I'm wrong) if I used Qprocess if main application closed so the started/external program will close too...I need to keep it running even if I close the main apps


rgds

marcel
23rd February 2008, 08:33
See QProcess::startDetached.

THRESHE
24th February 2008, 08:44
I suppose if you know the path to executable you can also use QDesktopServices::openUrl

rian191
25th February 2008, 03:59
See QProcess::startDetached.

Hi.. Marcell
thanks for your sugesstion but currently I'm using qt 3.... I can't find QProcess::startDetached...is there any similar function in qt 3

mchara
25th February 2008, 06:53
QProcess::~QProcess ()
Destroys the instance.

If the process is running, it is not terminated! The standard input, standard output and standard error of the process are closed.

You can connect the destroyed() signal to the kill() slot, if you want the process to be terminated automatically when the instance is destroyed.


Seems that application won't be closed automatically when your application closes.

On Qt 4


QProcess::~QProcess () [virtual]
Destructs the QProcess object, i.e., killing the process.
Note that this function will not return until the process is terminated.

That's because startDetached() method was added.

So in your case QProcess(qt3) should do exactly what you need.

regards