When Qt5 combobox added item, it was added twice in the list. Does anyone know why?

when Qt5 combobox adds item, the list appears to be added twice

void MainWindow::initSerialPort()
{
  foreach(const QSerialPortInfo &info, QSerialPortInfo::availablePorts())
  {
    qDebug()<<"Name"<<info.portName();
    qDebug()<<"Description"<<info.description();
    qDebug()<<"Manufacture"<<info.manufacturer();

    QSerialPort port;
    port.setPort(info);
    if(port.open(QIODevice::ReadWrite))
    {
        ui->cmbComName->addItem(info.portName());
        port.close();
    }

    QStringList baudRateList;
    baudRateList <<"4800"<<"9600"<<"19200"<<"57600"<<"115200";
    ui->cmdBaudRate->addItems(baudRateList);
    ui->cmdBaudRate->setCurrentIndex(1);

  }
}




Qt5
Apr.12,2022

Why does the UI control call addItem


foreach

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e46453-44b8d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e46453-44b8d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?