4/25/2023 0 Comments Qserialport qtmy_serialport->setPortName(ui->cmbPortName->currentText()).my_serialport = new QSerialPort( this ).if (ui->btnOpen->text() = "Open Serial Port" ).If you want to select manually, you can add the serial port name to the combox by listing it, and then select it when you use it. * Here we add the serial port we need to use to the combox by traversing all the serial ports. stopBitsListcmbStopBits->addItems(stopBitsList).dataBitsListcmbDataBits->addItems(dataBitsList).parityListcmbParity->addItems(parityList).baudListcmbBaudRate->addItems(baudList).//Close the serial port and wait for it to be opened manually (open the serial button).qDebug()cmbPortName->addItem(info.portName()).foreach ( const QSerialPortInfo &info, QSerialPortInfo::availablePorts()).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |