PDA

View Full Version : run a console application through a gui interface



gurinder
5th February 2008, 12:58
Hi All ,

I want to execute a shell script in a unix console through the click of button from GUI interface .

I dont know how to acess & execute a particular shell script from GUI.

Thanks in advance for your help.

Regards
Gurinder

jpn
5th February 2008, 13:09
Hi, see this thread (http://www.qtcentre.org/forum/f-qt-programming-2/t-system-in-qt-11445.html) (it's for Qt 4, but the same technique applies to Qt 3).

gurinder
5th February 2008, 13:49
hi

i tried using Qprocess below is the code

QObject *parent;
QString program = "/project/tspgfeip/usr/DCU/gurinder/dcu_regression/gurinder_verif_dcu_tb_vr.11.00.00.12/dcu/tool_data/scripts/run_single";
QStringList arguments;
arguments << "TestSet0";
QProcess *myProcess = new QProcess(parent);
myProcess->start( program,arguments);
}

it gives following error

form1.ui.h:1062: no matching function for call to `QProcess::start(QStringList&
)'
/usr/lib64/qt-3.1/include/qprocess.h:77: candidates are: virtual bool
QProcess::start(QStringList* = 0)
make: *** [.obj/form1.o] Error 1

jpn
5th February 2008, 13:52
You're attempting to use QProcess the way it works in Qt 4. You're using Qt 3 so you should read docs of Qt 3: QProcess.

PS. Do NOT pass an uninitialized pointer as parent!