It does not work. I have now made steg.h as
#ifndef STEG_H
#define STEG_H
#include "ui_stegform1.h"
#include <QProcess>
#include <QMessageBox>
{
Q_OBJECT
public:
// steg(QStringList s2)
//{
// _proc = new QProcess( this );
// _proc->setReadChannelMode( QProcess::MergedChannels );
// connect( _proc, SIGNAL( readyReadStandardOutput() ), this, SLOT( read()));
// connect( _proc, SIGNAL( finished(int, QProcess::ExitStatus) ), QCoreApplication::instance(), SLOT( quit() ) );
// _proc->start(("cjpeg"),s2);
// }
private slots:
void stego();
void read()
{
QMessageBox::information( 0,
"stego", _proc
->readAllStandardOutput
());
}
private:
Ui::steg ui;
};
#endif
#ifndef STEG_H
#define STEG_H
#include "ui_stegform1.h"
#include <QProcess>
#include <QMessageBox>
class steg : public QDialog
{
Q_OBJECT
public:
steg(QWidget *parent = 0);
QProcess *_proc;
// steg(QStringList s2)
//{
// _proc = new QProcess( this );
// _proc->setReadChannelMode( QProcess::MergedChannels );
// connect( _proc, SIGNAL( readyReadStandardOutput() ), this, SLOT( read()));
// connect( _proc, SIGNAL( finished(int, QProcess::ExitStatus) ), QCoreApplication::instance(), SLOT( quit() ) );
// _proc->start(("cjpeg"),s2);
// }
private slots:
void stego();
void read()
{
QMessageBox::information( 0, "stego", _proc->readAllStandardOutput());
}
private:
Ui::steg ui;
};
#endif
To copy to clipboard, switch view to plain text mode
and steg.cpp as
void steg::stego() /*** THIS MODULE HIDES CODED.TXT ***/
{
if(QFile::exists("coded.txt")) {
s2 << "-steg" << "coded.txt" << "-q" << ui.compressionspinBox->text() << "cleanimage.ppm" << ui.jpeglineEdit ->text() ;
//QProcess *_proc;
_proc
->setReadChannelMode
( QProcess::MergedChannels );
connect( _proc, SIGNAL( readyReadStandardOutput() ), this, SLOT( read()));
// connect( _proc, SIGNAL( finished(int, QProcess::ExitStatus) ), QCoreApplication::instance(), SLOT( quit() ) );
_proc->start(("cjpeg"),s2);
read();
}
void steg::stego() /*** THIS MODULE HIDES CODED.TXT ***/
{
if(QFile::exists("coded.txt"))
{
QStringList s2;
s2 << "-steg" << "coded.txt" << "-q" << ui.compressionspinBox->text() << "cleanimage.ppm" << ui.jpeglineEdit ->text() ;
//QProcess *_proc;
_proc = new QProcess( this );
_proc->setReadChannelMode( QProcess::MergedChannels );
connect( _proc, SIGNAL( readyReadStandardOutput() ), this, SLOT( read()));
// connect( _proc, SIGNAL( finished(int, QProcess::ExitStatus) ), QCoreApplication::instance(), SLOT( quit() ) );
_proc->start(("cjpeg"),s2);
read();
}
To copy to clipboard, switch view to plain text mode
I have to have _proc declared in steg.h since I use it in read() also.
I donot know where is the problem
Bookmarks