It is till the same
When I see in the task manager test1.exe is runing but visually there is nothing.main.cpp looks as below
#include <QApplication>
#include <QProcess>
#include <QStringList>
#include <QMessageBox>
#include <QtDebug>
{
Q_OBJECT
public:
Test()
{
_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", QStringList() << "aaa" << "bbb" );
}
private slots:
void read()
{
QMessageBox::information( 0,
"test", _proc
->readAllStandardOutput
() );
}
private:
};
int main( int argc, char **argv )
{
Test t;
return app.exec();
}
#include "main.moc"
#include <QApplication>
#include <QProcess>
#include <QStringList>
#include <QMessageBox>
#include <QtDebug>
class Test : public QObject
{
Q_OBJECT
public:
Test()
{
_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", QStringList() << "aaa" << "bbb" );
_proc->start( QCoreApplication::applicationDirPath() + "/cjpeg.exe", QStringList() << "aaa" << "bbb" );
}
private slots:
void read()
{
QMessageBox::information( 0, "test", _proc->readAllStandardOutput() );
}
private:
QProcess *_proc;
};
int main( int argc, char **argv )
{
QApplication app( argc, argv );
Test t;
return app.exec();
}
#include "main.moc"
To copy to clipboard, switch view to plain text mode
I was just wondering why you have given
QM
QMessageBox::information( 0,
"test", _proc
->readAllStandardOutput
() );
QMessageBox::information( 0, "test", _proc->readAllStandardOutput() );
To copy to clipboard, switch view to plain text mode
should it not be "Test".Though I changed to that too but still no result.
I want to know that when you started your exe what message did you get. Can you tellme that.
Bookmarks