【发布时间】:2015-01-28 18:18:07
【问题描述】:
当我编译我的程序时,我收到错误消息“QIODevice::write: device not open”这个程序在我的旧计算机上运行,但由于某种原因它在我的新计算机上运行不正常。任何有关如何解决此错误的见解将不胜感激,谢谢。
file.open(QIODevice::Append);
file2.open(QIODevice::Append);
QTextStream stream(&file); //stream of information
QTextStream stream2(&file2);
//write to file
//code continued here, deleted to post here... stream << whatever, stream2 << whatever whatever...
//end stream
stream << endl;
stream2 << endl;
//close file
file.close();
file2.close();
【问题讨论】:
-
有没有可能是文件没有打开?我的意思是没有权限在默认位置写。
-
是的,我认为你的权利让我检查一下