C++ (Qt) QString portName = ui->portNameComboBox->currentText(); QSerialPort::BaudRate baudRate = static_cast<QSerialPort::BaudRate> ( ui->baudRateComboBox->currentText().toInt() );
C++ (Qt)while(!asleep()) sheep++;
addItem ( const QString & text, const QVariant & userData = QVariant() )
setItemData ( int index, const QVariant & value, int role = Qt::UserRole )
QVariant QComboBox::itemData ( int index, int role = Qt::UserRole ) const
C++ (Qt) // Data Bits ui->dataBitsComboBox->addItem( "5", QSerialPort::Data5 ); ui->dataBitsComboBox->addItem( "6", QSerialPort::Data6 ); ui->dataBitsComboBox->addItem( "7", QSerialPort::Data7 ); ui->dataBitsComboBox->addItem( "8", QSerialPort::Data8 );
C++ (Qt) int currentIndex = ui->dataBitsComboBox->currentIndex(); QSerialPort::DataBits dataBits = ( QSerialPort::DataBits ) ui->dataBitsComboBox->itemData( currentIndex ); qDebug() << dataBits;
C++ (Qt) int currentIndex = ui->dataBitsComboBox->currentIndex(); QSerialPort::DataBits dataBits = static_cast<QSerialPort::DataBits>( ui->dataBitsComboBox->itemData( currentIndex ).toInt() );