[問題] QT QProcess 即時輸出 Stdout
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
QT Creator 5.4
Win7 x64
問題(Question):
各位大大好,我是QT新手,
上一篇本來問完要自刪,但不能..所以另發一篇,抱歉
我現在想用QT開一個Mainwindows呼叫一個Dialog,
然後在Dialog下按一個按鈕去執行一個外部程式,
之後可以把程式的stdout輸出到 plainTextEdit,
試了很多方法沒有沒辦法例如 readyRead(), readyReadStandardOutput(), readLine()
甚至用QTimer去讀都沒有用,他都一定要等到程式結束才會發出 readyRead(),
readyReadStandardOutput() 訊號
請問各位大大應該要怎麼即時顯示(或是得到即時字串)
程式碼(Code):(請善用置底文網頁, 記得排版)
假設外部程式test.exe原始碼:
http://codepad.org/lRJxxe2l
QT簡化後原始碼:
http://codepad.org/TC1QCfkJ
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.195.48.157
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1438955092.A.795.html
※ 編輯: qscgy4 (123.195.48.157), 08/07/2015 21:48:42
推
08/08 00:17, , 1F
08/08 00:17, 1F
→
08/08 00:18, , 2F
08/08 00:18, 2F
→
08/08 00:18, , 3F
08/08 00:18, 3F
→
08/08 00:19, , 4F
08/08 00:19, 4F
→
08/08 00:19, , 5F
08/08 00:19, 5F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章