2025-05-13 17:48:58 +00:00
|
|
|
|
/**
|
|
|
|
|
* @file GF3StripPatchProcess/main.cpp
|
|
|
|
|
* @brief Main entry point for the GF3 Strip Patch Process application.
|
|
|
|
|
* @details <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>GF3<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @author <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(3045316072@qq.com)
|
|
|
|
|
* @date 2025-05-12
|
|
|
|
|
* @version 1.0
|
|
|
|
|
*/
|
2025-05-08 15:00:13 +00:00
|
|
|
|
#include <QtCore/QCoreApplication>
|
2025-05-20 07:18:00 +00:00
|
|
|
|
#include "QGF3StripBatchProcessDialog.h"
|
|
|
|
|
#include <QtWidgets/QApplication>
|
2025-05-22 03:01:52 +00:00
|
|
|
|
#include <QDateTime>
|
|
|
|
|
#include <QFile>
|
|
|
|
|
#include <QTextStream>
|
2025-05-22 09:28:20 +00:00
|
|
|
|
#include <iostream>
|
2025-05-13 17:48:58 +00:00
|
|
|
|
|
2025-05-22 03:01:52 +00:00
|
|
|
|
#pragma execution_character_set("utf-8")
|
|
|
|
|
|
|
|
|
|
// <20>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void customMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg)
|
|
|
|
|
{
|
|
|
|
|
QByteArray localMsg = msg.toLocal8Bit();
|
|
|
|
|
const char* file = context.file ? context.file : "";
|
|
|
|
|
const char* function = context.function ? context.function : "";
|
|
|
|
|
QString dateTime = QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz");
|
|
|
|
|
|
|
|
|
|
QFile outFile("application.log");
|
|
|
|
|
outFile.open(QIODevice::WriteOnly | QIODevice::Append);
|
|
|
|
|
QTextStream ts(&outFile);
|
|
|
|
|
|
|
|
|
|
switch (type) {
|
|
|
|
|
case QtDebugMsg:
|
|
|
|
|
{
|
|
|
|
|
QString logMessage = QString("%1 Debug: %2 (%3:%4, %5)")
|
|
|
|
|
.arg(dateTime) // Assuming dateTime is a QDateTime object and needs to be converted to string
|
|
|
|
|
.arg(QString::fromLocal8Bit(localMsg.constData()))
|
|
|
|
|
.arg(file)
|
|
|
|
|
.arg(context.line)
|
|
|
|
|
.arg(function);
|
|
|
|
|
ts << logMessage << "\n";
|
2025-05-22 09:28:20 +00:00
|
|
|
|
std::cout << logMessage.toLocal8Bit().constData() << std::endl;
|
|
|
|
|
break;
|
2025-05-22 03:01:52 +00:00
|
|
|
|
}
|
|
|
|
|
case QtInfoMsg:
|
|
|
|
|
{
|
|
|
|
|
QString logMessage = QString("%1 Info: %2 (%3:%4, %5)")
|
|
|
|
|
.arg(dateTime)
|
|
|
|
|
.arg(QString::fromLocal8Bit(localMsg.constData()))
|
|
|
|
|
.arg(file)
|
|
|
|
|
.arg(context.line)
|
|
|
|
|
.arg(function);
|
|
|
|
|
ts << logMessage << "\n";
|
2025-05-22 09:28:20 +00:00
|
|
|
|
std::cout << logMessage.toLocal8Bit().constData() << std::endl;
|
|
|
|
|
break;
|
2025-05-22 03:01:52 +00:00
|
|
|
|
}
|
|
|
|
|
case QtWarningMsg:
|
|
|
|
|
{
|
|
|
|
|
QString logMessage = QString("%1 Warning: %2 (%3:%4, %5)")
|
|
|
|
|
.arg(dateTime)
|
|
|
|
|
.arg(QString::fromLocal8Bit(localMsg.constData()))
|
|
|
|
|
.arg(file)
|
|
|
|
|
.arg(context.line)
|
|
|
|
|
.arg(function);
|
|
|
|
|
ts << logMessage << "\n";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case QtCriticalMsg:
|
|
|
|
|
{
|
|
|
|
|
QString logMessage = QString("%1 Critical: %2 (%3:%4, %5)")
|
|
|
|
|
.arg(dateTime)
|
|
|
|
|
.arg(QString::fromLocal8Bit(localMsg.constData()))
|
|
|
|
|
.arg(file)
|
|
|
|
|
.arg(context.line)
|
|
|
|
|
.arg(function);
|
|
|
|
|
ts << logMessage << "\n";
|
2025-05-22 09:28:20 +00:00
|
|
|
|
std::cout << logMessage.toLocal8Bit().constData() << std::endl;
|
|
|
|
|
break;
|
2025-05-22 03:01:52 +00:00
|
|
|
|
}
|
|
|
|
|
case QtFatalMsg:
|
|
|
|
|
{
|
|
|
|
|
QString logMessage = QString("%1 Fatal: %2 (%3:%4, %5)")
|
|
|
|
|
.arg(dateTime)
|
|
|
|
|
.arg(QString::fromLocal8Bit(localMsg.constData()))
|
|
|
|
|
.arg(file)
|
|
|
|
|
.arg(context.line)
|
|
|
|
|
.arg(function);
|
|
|
|
|
ts << logMessage << "\n";
|
2025-05-22 09:28:20 +00:00
|
|
|
|
std::cout << logMessage.toLocal8Bit().constData() << std::endl;
|
|
|
|
|
abort();
|
2025-05-22 03:01:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-05-13 17:48:58 +00:00
|
|
|
|
|
|
|
|
|
|
2025-05-22 09:28:20 +00:00
|
|
|
|
int main(int argc, char* argv[])
|
2025-05-08 15:00:13 +00:00
|
|
|
|
{
|
2025-05-22 03:01:52 +00:00
|
|
|
|
qInstallMessageHandler(customMessageHandler);
|
|
|
|
|
|
2025-05-22 09:28:20 +00:00
|
|
|
|
QApplication a(argc, argv);
|
2025-05-26 12:55:18 +00:00
|
|
|
|
|
|
|
|
|
QFile qssFile(u8"./QSS/AMOLED.qss");
|
|
|
|
|
if (qssFile.open(QFile::ReadOnly)) {
|
|
|
|
|
a.setStyleSheet(qssFile.readAll());
|
|
|
|
|
}
|
|
|
|
|
qssFile.close();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-05-20 07:18:00 +00:00
|
|
|
|
showQGF3StripBatchProcessDialog(nullptr);
|
2025-05-22 09:28:20 +00:00
|
|
|
|
return a.exec();
|
2025-05-08 15:00:13 +00:00
|
|
|
|
}
|