From 441d342778cc60a6b63431c753241a0e5e42ab8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=A2=E4=BF=8A?= Date: Tue, 17 Mar 2026 09:38:22 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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() 来获取客户端连接。