#include <QDir> //头文件   

QDir *TEST = new QDir;
    bool exist = TEST->exists("TEST");
    if(!exist)
    bool ok = TEST->mkdir("TEST");
   QString fileName = "TEST/1.txt";  
   QString str="今天的天气很好适合跑步";
   QFile file(fileName);
   if(!file.open(QIODevice::WriteOnly  | QIODevice::Text|QIODevice::Append))
   {
        qDebug() << "open fail!" << endl;
   }
   QTextStream in(&file);
   in<<":"+str<<"\n";
   file.close();

相关文章:

  • 2021-08-08
  • 2021-11-26
  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-02
  • 2022-02-24
  • 2022-12-23
  • 2021-12-05
  • 2021-12-11
相关资源
相似解决方案