mainwindow.cpp
/**
 * @brief MainWindow::on_actionStart_triggered
 *
 * This function is triggered when play button in
 * menubar is clicked.
 */
@brief MainWindow::on_actionStart_triggered
This function is triggered when play button in
menubar is clicked.
@brief MainWindow :: on_actionStart_triggered This function is triggered when play button in menubar is clicked .
void MainWindow::on_actionStart_triggered()
{
    if(this->port == NULL)
        return;
    if(portConfig.status == OPENED)
    {
        return;
    }
    int ret = this->port->open(QIODevice::ReadWrite);
    if(ret == false)
    {
        QSerialPort::SerialPortError a;
        a = this->port->error();
        QMetaEnum err= QMetaEnum::fromType<QSerialPort::SerialPortError>();
        QMessageBox::critical(this, "Port Open Error", err.valueToKey(int(a)));
        return;
    }
    portConfig.status = OPENED;
    QFont mono("Ubuntu Mono", 11, QFont::Bold);
    ui->pStatus->setText("Status: Open");
    ui->pStatus->setFont(mono);
}
void MainWindow :: on_actionStart_triggered ( ) { if ( this -> port == NULL ) return ; if ( portConfig . status == OPENED ) { return ; } int ret = this -> port -> open ( QIODevice :: ReadWrite ) ; if ( ret == false ) { QSerialPort :: SerialPortError a ; a = this -> port -> error ( ) ; QMetaEnum err = QMetaEnum :: fromType < QSerialPort :: SerialPortError > ( ) ; QMessageBox :: critical ( this , " " , err . valueToKey ( int ( a ) ) ) ; return ; } portConfig . status = OPENED ; QFont mono ( " " , 11 , QFont :: Bold ) ; ui -> pStatus -> setText ( " " ) ; ui -> pStatus -> setFont ( mono ) ; }
@brief MainWindow::on_actionStart_triggered
 This function is triggered when play button in
 menubar is clicked.
@brief MainWindow :: on_actionStart_triggered This function is triggered when play button in menubar is clicked .
//qDebug() << "port already open!"; //qDebug() << "port open retval: " << ret << " name: " << port->portName() << "isope:" << port->isOpen(); // Set scroll bar to bottom // QScrollBar *sb = ui->textBrowser->verticalScrollBar(); // sb->setValue(sb->maximum());