[Solved]QT widget doesnt work due to open a file in a QProcess
-
At first sight, you try to open a file with perl that is still opened by QFile (the data might be still in a buffer and not yet on the disk).
What happens if you close inputFile before calling your perl script ?
-
tried and the same. no output.
-
Just in case, did you saw that your inputFile is "/fs1/PerlQt/QtCreator/test/variables.inp" and your script is "./fs1/PerlQt/QtCreator/test/test.pl" <= There's a dot in front here.
-
By default QProcess is started with a working directory of the calling process. Since you have a relative path in your perl script it is looking for input file in the directory of your executable, not where the script file is. Use QProcess::setWorkingDirectory() to change that.
-
@SGaist: ./ is for start the script here. This is normal linux stuff, but thanks for the hint.
@krzysztof: i catch stderr, so ishould get an error,file not found and the perlscript should print the first aggah and then i shold get errormessage, because the file is processed after the print command. Setting the file to an absolut path didnt work as well.but anyway thanks to u guys.
Hope we will find the error, any others thoughts.... -
Ok, this might be stupid because I know little about linux and how QProcess behaves there, but maybe this would work?
@
perl.start("perl ./fs1/PerlQt/QtCreator/test/test.pl");
@ -
as well no output.
-
That's why i suggested you to double check the use of "./" since your inputFile path is an absolute path but your perl script path is relative. That might be the culprit.
-
Hi,
i changed everything to absolute paths and started the perl with
perl.start("perl /fs1/PerlQt/QtCreator/test/test.pl");
Thats not the problem. there is still no output.
-
Did you check the working directory of your perl script ?
Besides that, make it print the content of the current directory, that might give your some clues -
For all whoo are interessted in.
The problem was the following code in perl, which wasnt correctly compiled due QT.@open incl, 'variables.inp' or die "Datei nicht gefunden $!"; # open the file variables.inp@
This line open a file and if the file not exists the applikation die and print file not found.
I found out, that without the booleen or die everything is ok and worked.Thanks for all your post and the help.
Greetz