16,212
社区成员
发帖
与我相关
我的任务
分享
foreach(const QSerialPortInfo &info, QSerialPortInfo::availablePorts())
{
QSerialPort serial;
serial.setPort(info);
if(serial.open(QIODevice::ReadWrite))
{
portNumBox->addItem(info.portName());
portMsgBrowser->append(tr("Serial Port Message:"));
portMsgBrowser->append(info.portName());
portMsgBrowser->append(info.description());
portMsgBrowser->append(info.manufacturer());
portMsgBrowser->append(info.serialNumber());
serial.close();
}
}
错误信息是:c:\users\qt\work\qt\qtbase\src\corelib\tools\qscopedpointer.h:141: error: Exception at 0x6c26da1a, code: 0xc0000005: read access violation at: 0x0, flags=0x0 (first chance)
求解