rendered paste bodyrequire 'Qt4'class Test < Qt::Widgetslots "test()" , "timer_action()" , "process_finished()"def initialize()super@button = Qt::PushButton.new self@timer = Qt::Timer.new @process = Qt::Process.newconnect @button , SIGNAL("clicked()") , self , SLOT("test()")connect @timer , SIGNAL("timeout()") , self , SLOT("timer_action()")connect @process , SIGNAL("finished(int, QProcess::ExitStatus)") , self , SLOT("process_finished()")enddef test# process & some output# @process.start 'ruby' , ['-e', '1.upto(3){|i| sleep 1; puts i}']@process.start 'ruby' , ['-e', '3.times{|i| sleep 1; puts i+1}'] , Qt::IODevice::ReadOnly|Qt::IODevice::Unbuffered@timer.start 1001enddef timer_actionputs 'timer'# @process.waitForReadyRead 0txt = @process.readAll# the problem: readAll doesn't pickup the output until the process finished, is there a way to get the output while the process is still running?unless txt.empty?puts 'live' , txt # doesn't get hereendenddef process_finishedputs "process_finished"# puts 'dead' , @process.readAll@timer.stopendendapp = Qt::Application.new ARGVt = Test.newt.showapp.exec