2013-08-13 18:48:36 +02:00
|
|
|
#pragma GCC diagnostic ignored "-Weffc++"
|
2013-06-20 16:09:50 +02:00
|
|
|
#include "mainwindow.h"
|
|
|
|
#include <QApplication>
|
2013-07-03 14:29:26 +02:00
|
|
|
#include <QTextCodec>
|
2013-08-13 18:48:36 +02:00
|
|
|
#pragma GCC diagnostic warning "-Weffc++"
|
2013-06-20 16:09:50 +02:00
|
|
|
|
2013-07-25 14:00:51 +02:00
|
|
|
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);
|
2013-07-03 14:29:26 +02:00
|
|
|
QApplication app(argc, argv);
|
2013-06-20 16:09:50 +02:00
|
|
|
MainWindow w;
|
2013-07-03 14:29:26 +02:00
|
|
|
app.setWindowIcon(QIcon(":/icon/64x64/icon64x64.png"));
|
2013-06-20 16:09:50 +02:00
|
|
|
w.show();
|
|
|
|
|
2013-07-03 14:29:26 +02:00
|
|
|
return app.exec();
|
2013-06-20 16:09:50 +02:00
|
|
|
}
|