Results 1 to 20 of 53

Thread: How To Redirect The Console Output To A Text Browser/pop Up

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #29
    Join Date
    May 2006
    Posts
    68
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    10

    Default Re: How To Redirect The Console Output To A Text Browser/pop Up

    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

    Qt Code:
    1. #include <QApplication>
    2. #include <QProcess>
    3. #include <QStringList>
    4. #include <QMessageBox>
    5. #include <QtDebug>
    6.  
    7. class Test : public QObject
    8. {
    9. Q_OBJECT
    10. public:
    11. Test()
    12. {
    13. _proc = new QProcess( this );
    14. _proc->setReadChannelMode( QProcess::MergedChannels );
    15.  
    16. connect( _proc, SIGNAL( readyReadStandardOutput() ), this, SLOT( read() ) );
    17. //connect( _proc, SIGNAL( finished(int, QProcess::ExitStatus) ), QCoreApplication::instance(), SLOT( quit() ) );
    18. // _proc->start( "cjpeg", QStringList() << "aaa" << "bbb" );
    19. _proc->start( QCoreApplication::applicationDirPath() + "/cjpeg.exe", QStringList() << "aaa" << "bbb" );
    20. }
    21. private slots:
    22. void read()
    23. {
    24. QMessageBox::information( 0, "test", _proc->readAllStandardOutput() );
    25. }
    26.  
    27. private:
    28. QProcess *_proc;
    29. };
    30. int main( int argc, char **argv )
    31. {
    32. QApplication app( argc, argv );
    33. Test t;
    34. return app.exec();
    35. }
    36. #include "main.moc"
    To copy to clipboard, switch view to plain text mode 

    I was just wondering why you have given
    QM
    Qt Code:
    1. 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.
    Last edited by deekayt; 5th December 2006 at 01:47.

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. No output to console
    By Morea in forum Newbie
    Replies: 6
    Last Post: 1st November 2007, 22:51
  3. No console output in Mac OSX using Qt4
    By popoholic in forum Qt Programming
    Replies: 2
    Last Post: 26th September 2006, 01:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.