QFile添加日志打印
#include <QFile>
static QFile file;
void printLog(QString str){
if(file.isOpen()){
file.write(str.toUtf8());
file.flush();
}else{
file.setFileName("/root/AuboRobotWorkSpace/teachpendant/text.txt");
if(file.open(QFile::ReadWrite)){
file.write(str.toUtf8());
file.flush();
}
}
}