qt程序编译遇到的问题
代码如下
void addscore::okclicked()
{
QFile file("file.txt");
if(file.open(IO_WriteOnly))
{
QTextStream stream(&file);
stream<<NameLE->text()<<","<<IpNumLE->text()<<"\n";
file.flush();
file.close();
}
this->close();
CallOperate(7,IpNumLE->text(),NameLE->text(), "");
}
addscore.cpp:70: error: ‘IO_WriteOnly’ was not declared in this scope
#include《QFile》已经加进去了。还报这个错误。
[解决办法]
1. 就该报这种错
题外:你在哪儿 看到的 IO_WriteOnly 这种写法呢?
[解决办法]
QFile::ReadWrite