123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #include "mainwindow.h"
- #include "launchpage.h"
- #include <QApplication>
- #include <QElapsedTimer>
- #include <QDebug>
- #include <QSplitter>
- #include <QTextEdit>
- #include <QString>
- #include <QMutex>
- #include <QDateTime>
- #include <QFile>
- #include <QTextStream>
- #include "log.h"
- int main(int argc, char* argv[])
- {
- QApplication a(argc, argv);
- #if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
- QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- #endif
- // Log::setFormat(QString("[%1] [%2] : %3").arg(Log::INFO_FORMAT_TIME, Log::INFO_FORMAT_LEVEL, Log::INFO_FORMAT_CODE_MSG),"yyyy/MM/dd hh:mm:ss");
- // Log::setLevelFont(QtDebugMsg, {ConsoleFont::FORE_GROUND_BLUE});
- // Log::setOutLogPath("log_test/mlog.log");
- // Log::setLogSwitchover(LogSwitchoverType::FILE_SIZE, 5);
- // Log::setOutLogParamJsonPath("logjson/logsetting.json");
- // Log::setDistinguishLevel(true);
- qInstallMessageHandler(Log::messageOutput);
- QFont f = a.font();
- f.setFamily("微软雅黑");
- a.setFont(f);
- QElapsedTimer cost;
- cost.start();
- #if 0
- LaunchPage w;
- w.show();
- #endif
- #if 1
- qCritical("This is a test");
- MainWindow w;
- qDebug() << "window build cost:" << cost.elapsed() << " ms";
- w.show();
- #endif
- return (a.exec());
- }
|