QFile f("D:\\测试数据\\单波束数据\\灯浮.TGT");
if (!f.open(QIODevice::ReadOnly|QIODevice::Text))//打开指定文件
{
QMessageBox::about(NULL, "文件", "文件打开失败");
}
QTextStream txtInput(&f);
QString lineStr;
while (!txtInput.atEnd())
{
lineStr = txtInput.readLine(); //读取数据
QMessageBox::about(NULL, "字段数据", lineStr);
}
f.close();
标签:文件,about,NULL,qt,txtInput,lineStr,QIODevice,txt,读取 From: https://blog.51cto.com/u_15906863/5977831