串口通信 上位机模板 QT485 串口助手
暂无评分
SerialPortSetting::SerialPortSetting(QWidget*parent)
: QDialog(parent)
{
setupUi(this);
setFixedSize(220,319);
checkAPButton->setIcon(QIcon(":/images/finger_up.png"));
emitcheckAvailablePorts();
}
//检测可用串口并在可用串口号后面加上可用标志
voidSerialPortSetting::checkAvailablePorts()
{
foreach(constQSerialPortInfo&Info,QSerialPortInfo::availablePorts()){
//QSerialPortavailablePort;
//availablePort.setPortName(Info.portName());
//if(availablePort.open(QIODevice::ReadWrite)){
intindex=comCB->findText(Info.portName());
&nb