#ifndef NMDATALOGFILE_H #define NMDATALOGFILE_H #include "nmData_global.h" #include class QFile; class QTextStream; class NM_DATA_EXPORT nmDataLogFile : public QObject { Q_OBJECT public: explicit nmDataLogFile(QObject *parent = nullptr); ~nmDataLogFile(); // 获取对象,单例模式 static nmDataLogFile* getInstance(); // 写日志文件 void writeLog(const QString &message); private: static nmDataLogFile* s_instance; QTextStream* m_textStream; QFile* m_logFile; signals: }; #endif // NMDATALOGFILE_H