It does not work. I have now made steg.h as
Qt Code:
  1. #ifndef STEG_H
  2. #define STEG_H
  3. #include "ui_stegform1.h"
  4. #include <QProcess>
  5. #include <QMessageBox>
  6. class steg : public QDialog
  7. {
  8. Q_OBJECT
  9. public:
  10. steg(QWidget *parent = 0);
  11. QProcess *_proc;
  12. // steg(QStringList s2)
  13. //{
  14. // _proc = new QProcess( this );
  15. // _proc->setReadChannelMode( QProcess::MergedChannels );
  16. // connect( _proc, SIGNAL( readyReadStandardOutput() ), this, SLOT( read()));
  17. // connect( _proc, SIGNAL( finished(int, QProcess::ExitStatus) ), QCoreApplication::instance(), SLOT( quit() ) );
  18. // _proc->start(("cjpeg"),s2);
  19. // }
  20.  
  21. private slots:
  22. void stego();
  23. void read()
  24. {
  25. QMessageBox::information( 0, "stego", _proc->readAllStandardOutput());
  26. }
  27. private:
  28. Ui::steg ui;
  29. };
  30. #endif
To copy to clipboard, switch view to plain text mode 

and steg.cpp as

Qt Code:
  1. void steg::stego() /*** THIS MODULE HIDES CODED.TXT ***/
  2. {
  3. if(QFile::exists("coded.txt"))
  4. {
  5. s2 << "-steg" << "coded.txt" << "-q" << ui.compressionspinBox->text() << "cleanimage.ppm" << ui.jpeglineEdit ->text() ;
  6. //QProcess *_proc;
  7. _proc = new QProcess( this );
  8. _proc->setReadChannelMode( QProcess::MergedChannels );
  9.  
  10. connect( _proc, SIGNAL( readyReadStandardOutput() ), this, SLOT( read()));
  11. // connect( _proc, SIGNAL( finished(int, QProcess::ExitStatus) ), QCoreApplication::instance(), SLOT( quit() ) );
  12. _proc->start(("cjpeg"),s2);
  13. read();
  14. }
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