問題:
主線程connect 發送信号和槽函數,但在子線程中發送信号時,槽函數無響應,導緻資料發送不出去。
解決方法:
1,設定 connection type為direct connection。
2,在write函數後面增加waitForBytesWritten()。
參考:
https://doc.qt.io/qt-5/threads-qobject.html
https://doc.qt.io/archives/qt-4.8/qiodevice.html
問題:
主線程connect 發送信号和槽函數,但在子線程中發送信号時,槽函數無響應,導緻資料發送不出去。
解決方法:
1,設定 connection type為direct connection。
2,在write函數後面增加waitForBytesWritten()。
參考:
https://doc.qt.io/qt-5/threads-qobject.html
https://doc.qt.io/archives/qt-4.8/qiodevice.html