请教:linux下Qt读取串口的问题
展开全部
de=C/C++][/void Download::readMyCom()
{
qWarning("read!");
qDebug() << "read: "<< myCom->bytesAvailable()<<"bytes";
QByteArray temp = myCom->readAll();
ui->textBrowser->insertPlainText(temp);
QFile file("write2fileName");
//如果打开失败则给出提示并退出函数
if(!file.open(QFile::Append | QIODevice::Text)){
qWarning("fail to open the file!");
return;
}
QDataStream out(&file);
{
qWarning("read!");
qDebug() << "read: "<< myCom->bytesAvailable()<<"bytes";
QByteArray temp = myCom->readAll();
ui->textBrowser->insertPlainText(temp);
QFile file("write2fileName");
//如果打开失败则给出提示并退出函数
if(!file.open(QFile::Append | QIODevice::Text)){
qWarning("fail to open the file!");
return;
}
QDataStream out(&file);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询