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();
100字范文,内容丰富有趣,生活中的好帮手!