I am running an external process ( dos exe file runnable on command prompt) through Q process
I need to capture the error messages and either display them in the text browser ( which is static in my form) or make custom made message (depending on what the exe program has given ) and then display them in the textbrowser/popUP
Earlier I was able to do so in qt3.3.4 on linux with the following code
system ( "/root/stego/encrypt.sh >& /root/stego/error.txt" );
textBrowser->clear();
textBrowser->setSource( "/root/stego/error.txt") ;
system ( "/root/stego/encrypt.sh >& /root/stego/error.txt" );
textBrowser->clear();
textBrowser->setSource( "/root/stego/error.txt") ;
To copy to clipboard, switch view to plain text mode
where I was running the command prompt command through a script file ( encrypt.sh in above case) and redirecting the screen output to error .txt and then redirecting it to text browser.
Now in qt 4 ( windows) I am using the Qprocess as under
void steg::encrypt()
{
char encrypt_comand[]= "-e";
char key_comand[]= "-k=";
s3 << encrypt_comand << ui.datalineEdit->text() << "coded.txt" << ( key_comand + ui.passphraselineEdit->text() );
}
void steg::encrypt()
{
char encrypt_comand[]= "-e";
char key_comand[]= "-k=";
QStringList s3;
s3 << encrypt_comand << ui.datalineEdit->text() << "coded.txt" << ( key_comand + ui.passphraselineEdit->text() );
QProcess::startDetached( QString("burp.exe"),s3 );
}
To copy to clipboard, switch view to plain text mode
The burp.exe is command prompt command and gives the ok/error messages on the screen ( on console). How to direct the same to a text file.Then compare and show a custom message say in a text browser or I can even resort to pop message( why not?/let me improve with qt 4)
Thanks in advance for the guidance.
Bookmarks