TimeRun Cit
TimeRun Cit

Reputation: 177

How to start an application using QT and C++

I am trying to start an application(.exe) using QT in windows environment. The below code giving an error while running my project.

Error:
The inferior stopped because it received a signal from the Operating System.
Signal name : SIGSEGV 
Signal meaning : Segmentation fault

When running:

QString path = "C:/Temp/myproject/AppTest.exe";

QProcess process;
process.execute(path)

Upvotes: 2

Views: 675

Answers (1)

Wylie Coyote SG.
Wylie Coyote SG.

Reputation: 1029

I think you should create a function for this and use relative paths. I think the command you need here is process->start(path, arguments) You will also need to set a QProcessEnviorment; Something like this:

QProcess *process = new QProcess( parent );
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
process->setProcessEnvironment(env);
process->start(execPrgm, args);

I Hope this helps!

Upvotes: 1

Related Questions