void debug_msg(QVariant msg)
{
    static int i = 0;

    QFile file("debug_msg.txt");
    if (i == 0)
    {
        i = 1;
        file.open(QFile::WriteOnly | QFile::Truncate | QFile::Text);
    }
    else
    {
        file.open(QFile::WriteOnly | QFile::Append | QFile::Text);
    }

    file.write(msg.toString().toStdString().c_str());
    file.write(QString("\n").toStdString().c_str());
    file.close();
}

 

相关文章:

  • 2021-10-17
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
  • 2021-10-03
  • 2021-05-19
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-06
  • 2021-05-21
相关资源
相似解决方案