2024-10-28 19:15:01 -04:00
|
|
|
#include "mainwindow.h"
|
|
|
|
|
|
|
|
|
|
#include <QApplication>
|
|
|
|
|
|
2024-11-02 19:19:53 -04:00
|
|
|
class Rule;
|
|
|
|
|
|
|
|
|
|
void HexesLogOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
|
|
|
|
{
|
|
|
|
|
QByteArray localMsg = msg.toLocal8Bit();
|
|
|
|
|
switch (type) {
|
|
|
|
|
case QtDebugMsg:
|
|
|
|
|
fprintf(stderr, "Debug: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
|
|
|
|
|
break;
|
|
|
|
|
case QtInfoMsg:
|
|
|
|
|
fprintf(stderr, "Info: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
|
|
|
|
|
break;
|
|
|
|
|
case QtWarningMsg:
|
|
|
|
|
fprintf(stderr, "Warning: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
|
|
|
|
|
break;
|
|
|
|
|
case QtCriticalMsg:
|
|
|
|
|
fprintf(stderr, "Critical: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
|
|
|
|
|
break;
|
|
|
|
|
case QtFatalMsg:
|
|
|
|
|
fprintf(stderr, "Fatal: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
|
|
|
|
|
abort();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-28 19:15:01 -04:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
|
{
|
2024-11-02 19:19:53 -04:00
|
|
|
qInstallMessageHandler(HexesLogOutput);
|
2024-10-28 19:15:01 -04:00
|
|
|
QApplication a(argc, argv);
|
2024-11-02 19:19:53 -04:00
|
|
|
|
|
|
|
|
qRegisterMetaType<Rule>("Rule");
|
|
|
|
|
qRegisterMetaType<QQueue<Rule>>("QQueue<Rule>");
|
|
|
|
|
|
2024-10-28 19:15:01 -04:00
|
|
|
MainWindow w;
|
|
|
|
|
w.show();
|
|
|
|
|
return a.exec();
|
|
|
|
|
}
|