Results 1 to 4 of 4

Thread: process not emiting any signals

  1. #1
    Join Date
    Aug 2011
    Location
    bangalore
    Posts
    14
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default process not emiting any signals

    hi, some one please tell me ..i am trying to executing some commands through QProcess some commands are executing properly they are emiting appropriate readyreadstandardoutput and error signals but few commands not emitting any signals...please tell me what's the problem...i am executing this in unix

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: process not emiting any signals

    The problem is your code. How do you think we can help without seeing your code or knowing anything about the processes that work/don't work?

    Perhaps those processes do not output anything to the stdout or stderr streams. Perhaps the executable cannot be found to execute or is not an executable. Are you connecting the error() or finished() signal? Are you looking at the exitCode() and/or exitState()?

  3. #3
    Join Date
    Aug 2011
    Location
    bangalore
    Posts
    14
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: process not emiting any signals

    SORRY ,here is my code

    Qt Code:
    1. costructor
    2. {
    3. proc = new QProcess();
    4. proc->start( "tclsh" );
    5.  
    6. textEdit->addAction( actionClear_All );
    7. // connects
    8. connect( proc, SIGNAL( readyReadStandardOutput() ), this, SLOT( captureProcessOutput() ));
    9. connect( proc, SIGNAL( readyReadStandardError() ), this, SLOT( captureProcessError() ));
    10.  
    11. connect( lineEdit, SIGNAL( returnPressed() ), this, SLOT( lineEditReturnPressed() ) );
    12. connect( proc, SIGNAL( finished( int, QProcess::ExitStatus) ), this, SLOT( processFinished(int,QProcess::ExitStatus ) ));
    13.  
    14. }
    15. void MainWindow::lineEditReturnPressed()
    16. {
    17. proc->write( qPrintable( lineEdit->text()+'\n' ) );
    18. }
    19.  
    20. void MainWindow::captureProcessOutput()
    21. {
    22. textEdit->append( proc->readAllStandardOutput() );
    23. }
    24. void MainWindow::captureProcessError()
    25. {
    26. textEdit->append( proc->readAllStandardError() );
    27. }
    28. void MainWindow::processFinished( int exitCode, QProcess::ExitStatus )
    29. { Q_UNUSED( exitCode );
    30. qApp->quit();
    31. }
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Mar 2009
    Location
    Poland
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: process not emiting any signals

    Create object and make connection :
    Qt Code:
    1. proc = new QProcess();
    2. connect( proc, SIGNAL( readyReadStandardOutput() ), this, SLOT( captureProcessOutput() ));
    3. connect( proc, SIGNAL( readyReadStandardError() ), this, SLOT( captureProcessError() ));
    4. connect( proc, SIGNAL( finished( int, QProcess::ExitStatus) ), this, SLOT( processFinished(int,QProcess::ExitStatus ) ));
    To copy to clipboard, switch view to plain text mode 
    and start your proc
    Qt Code:
    1. proc->start( "tclsh" );
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 7th February 2012 at 12:37. Reason: missing [code] tags

Similar Threads

  1. Replies: 8
    Last Post: 29th June 2010, 07:10
  2. Emiting signals from plugin
    By troorl in forum Qt Programming
    Replies: 0
    Last Post: 4th March 2009, 15:26
  3. not emiting signal
    By bisz in forum Newbie
    Replies: 4
    Last Post: 3rd October 2007, 07:49
  4. Replies: 8
    Last Post: 17th April 2007, 14:36
  5. emiting signals from const member functions !?
    By sunil.thaha in forum Qt Programming
    Replies: 2
    Last Post: 25th March 2006, 11:29

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.