17#include <qapplication.h>
28QString readResource(
const QString& fileName )
30 QFile resourceFile( fileName );
32 if( !resourceFile.open( QFile::ReadOnly | QFile::Text) )
33 return resourceFile.errorString();
35 QTextStream in( &resourceFile );
36 QString text = in.readAll();
51void swMessageOutput( QtMsgType type,
const QMessageLogContext &context,
const QString &msg)
53 QByteArray localMsg = msg.toLocal8Bit();
54 const char *file = context.file ? context.file :
"";
55 const char *function = context.function ? context.function :
"";
58 fprintf(stderr,
"Debug: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);
61 fprintf(stderr,
"Info: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);
64 fprintf(stderr,
"Warning: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);
67 fprintf(stderr,
"Critical: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);
70 fprintf(stderr,
"Fatal: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);