(QT / kdelib) how do I know the end of a command in the KTerminalInterface?

I have a KTerminalInterface (from kparts) in my qt / kdelib application and I run a command in it.

The problem is this: how can I know if the program has finished? I need to know this because at the end I have to reset some variable.

Does anyone have a similar problem?!?

+1


source to share


2 answers


Unable to communicate with a process after launching via TerminalInterface in KDE 4, because KonsolePart (which implements TerminalInterface) no longer has processExited () or receivedData () handlers. In KDE 4, KonsolePart is for interactive terminal sessions, not your application.



In KDE 4, use KProcess to invoke an external command from your application, contact it, and determine when it exits. See the QProcess portions of their API.

+2


source


you can use os.waitpid (-1) to wait for child processes (with a different thread if you can't have a main block).



0


source







All Articles