skip the line and it should work.
skip the line and it should work.
It still shows the output only in the Application Output when i run and click on the PushButton. Where am i goin wrong???
Is result correct? What do you see if you put afterwards?
EDIT:
Do you call that snippet after the finished() signal was emitted?
This is what i am trying to do.
I have a Widget project with a Push Button and a Text Edit wherin when the button is clicked the Qprocess executes the command and gives the output.
This is the code i have written. I can see the QProcess executing the command and fetching the details in the Application Output Window. I want to fetch the Output as a String and see that output in the Text Edit.
Qt Code:
QProcess proc; proc.execute("uname -s"); ui->textEdit->setText(command);To copy to clipboard, switch view to plain text mode
Last edited by Lykurg; 16th November 2011 at 19:56. Reason: missing [code] tags
Well, you have to use start(), not execute(). Then either use the signal or wait till execution is finished, but that will block your ui. But since uname is fast, that shouldn't be a problem. Also please use the [code]-tags!
Qt Code:
QProcess proc; proc.waitForFinished(); command = command.trimmed(); qWarning() << command;To copy to clipboard, switch view to plain text mode
Thanks a lot Sir.That worked. Am loving QT. Works Great.
Bookmarks