/[projects]/infoscreen/main.cpp
ViewVC logotype

Contents of /infoscreen/main.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 996 - (show annotations) (download)
Fri Jul 16 07:41:48 2010 UTC (13 years, 9 months ago) by torben
File size: 841 byte(s)
add message handler
1 #include <QApplication>
2 #include "mainview.h"
3 #include <QtDebug>
4
5
6 //TODO: write messages to log file
7 void myMessageOutput(QtMsgType type, const char *msg)
8 {
9 switch (type) {
10 case QtDebugMsg:
11 fprintf(stderr, "Debug: %s\n", msg);
12 break;
13 case QtWarningMsg:
14 fprintf(stderr, "Warning: %s\n", msg);
15 break;
16 case QtCriticalMsg:
17 fprintf(stderr, "Critical: %s\n", msg);
18 break;
19 case QtFatalMsg:
20 fprintf(stderr, "Fatal: %s\n", msg);
21 abort();
22 }
23 }
24
25
26
27 int main(int argc, char** argv) {
28
29 qInstallMsgHandler(myMessageOutput);
30 qDebug() << "--------------------------------------------------------------------------------------------";
31
32 QApplication app(argc,argv);
33 app.setApplicationName("infoscreen");
34
35 MainView main(0);
36 main.show();
37
38 return app.exec();
39 }

  ViewVC Help
Powered by ViewVC 1.1.20