My requirement is to get the console output to the text browser.( Message box and text edit)
I have tried the following code
void steg::encrypt()
{
char encrypt_comand[]= "-e";
char key_comand[]= "-k=";
s3 << encrypt_comand << ui.datalineEdit->text() << "coded.txt" << ( key_comand + ui.passphraselineEdit->text() );
P
->start
( QString("burp.exe"),s3
);
P->waitForFinished();
QString result_all
= P
->readAllStandardOutput
();
ui.textBrowser->setSource( result_all);
}
void steg::encrypt()
{
QProcess *P =new QProcess ;
char encrypt_comand[]= "-e";
char key_comand[]= "-k=";
QStringList s3;
s3 << encrypt_comand << ui.datalineEdit->text() << "coded.txt" << ( key_comand + ui.passphraselineEdit->text() );
P->start( QString("burp.exe"),s3 );
P->waitForFinished();
QString result_all= P->readAllStandardOutput();
ui.textBrowser->setSource( result_all);
}
To copy to clipboard, switch view to plain text mode
But it did not work . Then I tried to write the Qstring result_all to a file and then see the file manually.The file gets created but nothing is written to file. That means nothing is in QString result_ all . Then I tried to see that the Qstring result_all is put in the tetxEdit ( since setText is there and perhaps Url thing might be giving problem in TextBrowser) But that also did not work. Those codes are down below
file.setFileName("showjpegfile.txt");
out << result_all; //NOTHING HAPPENED
ui.textEdit->textCursor().insertText(result_all); //NOTHING HAPPENED
QFile file;
file.setFileName("showjpegfile.txt");
file.open(QIODevice::WriteOnly);
QTextStream out(&file);
out << result_all; //NOTHING HAPPENED
ui.textEdit->textCursor().insertText(result_all); //NOTHING HAPPENED
To copy to clipboard, switch view to plain text mode
How can I try to put in the message box
I tried the code below.But it doesnot work.
tr("<p>The <b>JPSTEGO</b> is a data hiding and extraction software"
"forhiding data while converting image files to JPEG format",
+result_all));
QMessageBox::about(this, tr("About JPSTEGO"),
tr("<p>The <b>JPSTEGO</b> is a data hiding and extraction software"
"forhiding data while converting image files to JPEG format",
+result_all));
To copy to clipboard, switch view to plain text mode
Bookmarks