Open the selected port
-
How can i get the current ports on a combo box and then open the choosen port?
I want to open it when i run the programvoid MainWindow::open_Serial() { serial->setPortName("/dev/ttyUSB0"); serial->setBaudRate(QSerialPort::Baud115200); serial->setDataBits(QSerialPort::Data8); serial->setParity(QSerialPort::NoParity); serial->setStopBits(QSerialPort::OneStop); serial->setFlowControl(QSerialPort::NoFlowControl); if (serial->open(QIODevice::ReadWrite)) { qDebug() << "ttyUSB0 is Open "; serial->clear(); write_Json(); connect(serial, &QSerialPort::readyRead, this, &MainWindow::on_Serial_Read); } if(serial->isOpen()) { ui->Open->setChecked(true); } else { ui->Close->setChecked(true); } }
-
Do you think posting a question after it has answered already 1 week ago will give you another answer?
https://forum.qt.io/topic/124316/find-the-current-port-and-open-it -
@Christian-Ehrlicher what will change if i think it?
Im just searching a solution to my problem. I solved it, you can delete my post. -
@suslucoder said in Open the selected port:
you can delete my post.
Why should I delete your post? I just asked why you open a new thread for a question which was answered for you one week ago.
-
@suslucoder said in Open the selected port:
I solved it, you can delete my post.
No, the solved posts don't get deleted. They remain for the benefit of other forum users having same/similar issues.
It's a community driven approach, opposite to a "my problem only" driven approach