From: Richard Dale Date: 2004-12-17T12:02:12+09:00 Subject: Re: rubyqt, popen problem in a log viewer Richard Dale wrote: > You could start 'tail' with a Qt::Process instead of popen(), as it ties > in with Qt signals/slots > and shuts down the sub process on application > exit Actually I'm wrong - Qt doesn't do this, you need to connect to the 'aboutToQuit()' application signal, and kill the 'tail' process on exit: @proc = Qt::Process.new(self) { addArgument "/usr/bin/tail" addArgument "-f" addArgument "/tmp/test" } connect( @proc, SIGNAL('readyReadStdout()'), self, SLOT('readFromStdout()') ) connect( $kapp, SIGNAL('aboutToQuit()'), self, SLOT('shutdown()') ) @proc.start end slots 'readFromStdout()', 'shutdown()' def readFromStdout lines = @proc.readStdout @hello.append lines.to_s end def shutdown @proc.kill end -- Richard