PDA

View Full Version : issues with kprocess and qprocess



soul_rebel
6th April 2006, 19:12
i have a problem with both of these classes. they seem to be unable to show output (std or err) from sub-processes spawned by the process they execute. what i need them for is to run the freebsd command portupgrade, this spawns extra process to fetch files and output is completely missing.
even if i run the command with an sh -c "..." frame or try to redirect it using | tee logfile it wont show up. if use the unix native file-descriptors and popen it works; but only when not run from inside kdevelop, i guess because kdevelop internally uses the kprocess to start the app.
is this default behaviour?
what can i do about it?

thawkins
7th April 2006, 20:39
(I don't remember what version you have but the methods below apply to Qt 4.0 or higher)

are you using the following methods in QProcess:

readAllStandardError ()
readAllStandardOutput()
readChannel()
setReadChannel()

This will all give you access to what's going on with Input/Output from a QProcess spawned process. Alternatively, you can try to pipe the data to a file.