【Qt6】error: Use of undeclared identifier ‘connect‘; did you mean ‘QAbstractSocket::connect‘?

2023年10月14日,周六上午

今天遇到了这个问题并找到了解决办法,于是记录下来

【Qt6】error: Use of undeclared identifier ‘connect‘; did you mean ‘QAbstractSocket::connect‘?_第1张图片


产生问题的原因

没有继承QObject

【Qt6】error: Use of undeclared identifier ‘connect‘; did you mean ‘QAbstractSocket::connect‘?_第2张图片

解决办法

继承QObject

【Qt6】error: Use of undeclared identifier ‘connect‘; did you mean ‘QAbstractSocket::connect‘?_第3张图片

【Qt6】error: Use of undeclared identifier ‘connect‘; did you mean ‘QAbstractSocket::connect‘?_第4张图片

你可能感兴趣的:(Qt,qt)