You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, June 7th 2011, 6:43am

how to open a exe file on clicking a button in qt

please try to give an example or the code

thank u in advance :)

This post has been edited 1 times, last edit by "sandy" (Jun 7th 2011, 6:49am)


pele1410

Trainee

  • "pele1410" is male

Posts: 126

Location: Lafayette, LA

  • Send private message

2

Tuesday, June 7th 2011, 12:56pm

If all you want to do is start another exe, this should do the trick.

Source code

1
2
3
QProcess *program = new QProcess(this);
QStringList args;
program->start("your.exe", args);


More than likely there's several signals you should connect to and deal with. It depends on what you're doing with the other exe. Look at the QProcess class and specifically the signals:

void started()
void error(QProcess::ProcessError)
void finished(int, QProcess::ExitStatus)
void stateChanged(QProcess::ProcessState)
"Without imperfection, you or I would not exist." ~Stephen Hawking

3

Tuesday, June 14th 2011, 11:13am

hi

Thank u for replying

I used system and i could open a executable file on clicking a pushbutton

To upgrade the same project ,I am trying to open a exe file in another system which is connected through ethernet.I am trying to use Sockets.I went throught server client programs given in the Qt examples. It would be helpful if u could suggest ideas

Thank u in advance [QT] :)