You are not logged in.

1

Friday, November 21st 2008, 7:27am

QProcess Problem

Hi
I have developed a software and in one part of it QProcess object starts an executable with QProcess::start(QString exepath) method

In windows it works perfect however in linux the program I have executed with qprocess is crashing and giving

Source code

1
QProcess:ProcessError= 1
I searched for it and it seems the program is starting and crashing in some time

So I have to understand where the problem is but I have a problem in this point because the executable I have started with qprocess is a console application and When I start it with qprocess I cant see the console output of that executable is there a way to see that executable console application's console outputs so that I can debug ?



Thanks

2

Tuesday, November 25th 2008, 9:36am

Are you looking for something like this?

void QProcess::setStandardOutputFile ( const QString & fileName, OpenModemode = Truncate )


and note that if you don't handle the output in any way, it's gonna go to memory, unless you specify that you don't want that


This, if not noted, may result in behaviour seeming like a memory leak, the size of which depends on the amount of output the executed program produces.

pele1410

Trainee

  • "pele1410" is male

Posts: 121

Location: Lafayette, LA

  • Send private message

3

Tuesday, December 2nd 2008, 2:29pm

Try QProcess::startDetached(QString exePath).
"Without imperfection, you or I would not exist." ~Stephen Hawking

4

Wednesday, August 4th 2010, 5:11pm

QT QProcess Problem in XP

Hello Guys,
I am going through a little bit different problem with QProcess. I Hope some one will know how to fix this.
QProcess -> start () works fine with constant string like "c:\\xyz\\abc.exe" but when I write the same Path in QLineEdit widget and get it as a text in variable
and put that in start function then its not doing any thing....

QProcess* process=new QProcess();
QString str=ui.myLineEditWidget->text();
process->start(str);




This is not working and I don't understand why is the reason. If any one has any idea. please help

5

Thursday, August 5th 2010, 6:26am

What string is in QLineEdit?

Quoted


but when I write the same Path

If it is "c:\xyz\abc.exe" then it must work.
Fighting fire with fire.
Three can keep a secret if two of them are dead.

6

Thursday, August 5th 2010, 9:24am

I think It should work but it seems like its not working..

QProcess *qp=new QProcess();
qp->start(ui.addressLineEdit->text());


and the path in the LineEditWidget is "c:\windows\system32\cmd.exe"
this is the code . I can't see why its not working.. very strange...
I am using QT 4.6.0 ...
any suggestions will be really helpful

=======================================================================
Finally I found an alternative for this ...
QProcess::startDetached() does the job...I definitely be doing some thing wrong in QProcess.start().....any way.. thanks for your help Messenger.

This post has been edited 1 times, last edit by "english_dany" (Aug 5th 2010, 9:37am)


7

Thursday, August 5th 2010, 10:16am

Actually "start" function starts new cmd.exe process but does not show the console. imo any console application will act same.
Fighting fire with fire.
Three can keep a secret if two of them are dead.