PDA

View Full Version : Opening A Terminal using QProcess



sujan.dasmahapatra
26th October 2009, 11:42
Dear Friends

I want to open a terminal in LINUX from within QT application !
I am trying this through QProcess
///////////////////////////////////////////////////////////////////////////
QProcess process(this);
process.setWorkingDirectory("./Grid/");
process.start("gedit gcf.dat");

/////////////////////////////////////////////////////////////////////////////

But I can't see any file is opening for editing in LINUX...What am I missing in this !

Any help would be greatly appreciated !

mcosta
3rd February 2011, 15:51
Hi,

can you post the entire code?
The QProcess::start() method returns immediatly then the QProcess instance must not go out of scope.

To verify the correct start of new process you must catch QProcess::started() and QProcess::error() signals.

You can also use QProcess::waitForStarted()