I get list of all COM ports and add their names to a QComboBox using this code:
QList<QSerialPortInfo> com_ports = QSerialPortInfo::availablePorts();
QSerialPortInfo port;
foreach(port, com_ports)
{
ui->comboBox_com_ports->addItem(port.portName());
}
I have only COM3 but availablePorts()
function returns two members which are like this:
What is wrong with my code?
Note: I use "MSVC2012 OpenGL 32bit" as compiler.