设备的打开方式:OpenMode
enum QIODevice::OpenModeFlag flags QIODevice::OpenMode
代码简单如下所示:
void AdControlWidget::insertRepairData() { QString pathstr = “/app/config/repairdata.txt”; QFile data(pathstr); if (data.open(QFile::WriteOnly |QIODevice::WriteOnly)) { // QTextStream out(&data); for(int i =0;i<8;i++) { out << forms[i]->getrepairtime(); out <<“,”; out << forms[i]->getrepairreason(); out << “\n”; } } data.close(); }免责声明:文章内容来自互联网,本站不对其真实性负责,也不承担任何法律责任,如有侵权等情况,请与本站联系删除。
转载请注明出处:QIODevice 设置 https://www.yhzz.com.cn/a/14463.html