-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
47 lines (43 loc) · 1.24 KB
/
main.cpp
File metadata and controls
47 lines (43 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "Mainwindow/mainwindow.h"
#include <QApplication>
#include <QFile>
#include <QTextStream>
#include "log/log.h"
#ifndef QT_NO_DEBUG
#include <qapplication.h>
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 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);
break;
}
}
#endif
int main(int argc, char *argv[])
{
#ifndef QT_NO_DEBUG
//qInstallMessageHandler(myMessageOutput);
#endif
QApplication a(argc, argv);
QFile qssF(":/qss/qss");
if(qssF.open(QFile::ReadOnly))
{
QTextStream stream(&qssF);
QString sss = stream.readAll();
a.setStyleSheet(sss);
}
qssF.close();
log_init(LL_DEBUG,"test","./log");
MainWindow w;
w.show();
w.InitData();
return a.exec();
}