valentina/main.cpp
2013-08-20 13:26:02 +03:00

39 lines
1.2 KiB
C++

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include "mainwindow.h"
#include <QApplication>
#include <QTextCodec>
#pragma GCC diagnostic pop
void myMessageOutput(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 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();
}
}
int main(int argc, char *argv[]){
qInstallMessageHandler(myMessageOutput);
QApplication app(argc, argv);
MainWindow w;
app.setWindowIcon(QIcon(":/icon/64x64/icon64x64.png"));
w.show();
return app.exec();
}