diff --git a/README.md b/README.md index 65e342b..d84ed6f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # 产测工具 -遇到问题: -2024.09.01 -1. 运行报错:QSocketNotifier: Socket notifiers cannot be enabled or disabled from another thread +## 遇到问题: + +### 2024.09.01 + 1. 运行报错:QSocketNotifier: Socket notifiers cannot be enabled or disabled from another thread 问题分析:主线程创建了 QTcpSocket,这个QTcpSocket的读写操作必须在主线程中执行,不能将QTcpSocket对象通过新建的对象传参后到新建对象中对QTcpSocket进行读写操作,所有的QTcpSocket 的操作都在与它关联的线程中执行。 问题解决:1. 在主线程中创建 QTcpSocket 并获取连接: 继续在主线程中使用 server->nextPendingConnection() 来获取客户端连接。