[Clam-devel] showing output of system calls

David García Garzón dgarcia at iua.upf.edu
Fri Jun 8 01:32:34 PDT 2007


Annotator has the TaskRunner class which does the following.
- opens a DockWidget on the bottom of the MainWindow
- embeds a text editor in it
- executes a command with QProcess (not blocking)
- prints the command line in blue on the text editor
- prints the command output highlighting error output in red
- after termination prints 'Done'
- sends a signal to the main application with the result
- waits 5 seconds and closes the dock widget

I used a refined version of this task runner for a different project which 
allowed multiple processes and process dependencies but you can just start 
with this one.


On Divendres 08 Juny 2007, Andreas Calvo wrote:
> Working with Faust, I need to make some system calls to compile the
> plugins. Now this is done using "system("mycommand")", which it's a little
> bit ugly. I've found that QT has a class named QProcess, which does this
> pretty nice. But I didn't find any good example in how to do that and show
> the output in a QT window (I've also been looking for a way to show a
> terminal shell in a QT window).
> Is there any good resource/example/how-to that I can look to?
>
> Thanks



-- 
David García Garzón
(Work) dgarcia at iua dot upf anotherdot es
http://www.iua.upf.edu/~dgarcia
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20070608/2f9f0db6/attachment-0003.pgp>


More information about the clam-devel mailing list