44 #include "Windows/mainwindow.h"
45 #include "Utils/info.h"
54 #include <QApplication>
56 #include <QSplashScreen>
78 void customMessageHandler(QtMsgType type,
const QMessageLogContext &context,
const QString &msg)
82 QString dt = QDateTime::currentDateTime().toString(
"dd/MM/yyyy hh:mm:ss");
83 QString txt = QString(
"[%1] ").arg(dt);
88 txt += QString(
"{Debug} \t\t %1").arg(msg);
89 mainWindow->
writeToLog(txt,_LogKndMessage, _LogLvMax);
92 txt += QString(
"{Warning} \t %1").arg(msg);
93 mainWindow->
writeToLog(txt,_LogKndWarning, _LogLvNormal);
96 txt += QString(
"{Critical} \t %1").arg(msg);
97 mainWindow->
writeToLog(txt,_LogKndError, _LogLvMin);
100 txt += QString(
"{Fatal} \t\t %1").arg(msg);
101 mainWindow->
writeToLog(txt,_LogKndError, _LogLvMin);
111 int main(
int argc,
char *argv[])
113 qInstallMessageHandler(customMessageHandler);
114 QApplication a(argc, argv);
117 QCoreApplication::setOrganizationName(CInfo::OrganizationName());
121 QPixmap pixmap(
":/Resources/Images/splashscreen_mne_browse_raw_qt.png");
122 QSplashScreen splash(pixmap);
129 splash.finish(mainWindow);
static const QString AppNameShort()
void writeToLog(const QString &logMsg, LogKind lgknd, LogLevel lglvl)