Skip to content

Latest commit

 

History

History
17 lines (17 loc) · 386 Bytes

添加日志打印.md

File metadata and controls

17 lines (17 loc) · 386 Bytes

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();
        }
    }
}