首先感谢各位来看我的帖子。
我的系统是Centos 6.1的,Qt版本是4.6.3的。现在我在/opt 目录下有一个文件
file.txt:
gps_info:1
Time:23:9:35
Latitude:3029.374268N
Longitude:11423.346680E
Altitude:3.400000
Available_satellite_number:04
现在要把它们从文件中读出来,然后送到界面显示。我想了一下,现在我能够得到这些数据,我是将其存放在数组中的,我想来想去,不知道真么做了,求感人给点提示~ 谢谢~
(这个文件60秒更新一次)
------解决方案--------------------
到哪做不下去了啊
------解决方案--------------------
//...
QFile file("./help.txt");
if (!file.open(QFile::ReadOnly
------解决方案--------------------
QFile::Text))
{
QMessageBox::warning(this, tr("Application"),
tr("Cannot read file %1:\n%2.")
.arg("./help.txt")
.arg(file.errorString()));
return;
}
QTextStream in(&file);
textBrowser->setPlainText(in.readAll());
file.close();
//...
你把这段代码添加上去,不需要数组什么的了