main.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #include "mainwindow.h"
  2. #include "launchpage.h"
  3. #include <QApplication>
  4. #include <QElapsedTimer>
  5. #include <QDebug>
  6. #include <QSplitter>
  7. #include <QTextEdit>
  8. #include <QString>
  9. #include <QMutex>
  10. #include <QDateTime>
  11. #include <QFile>
  12. #include <QTextStream>
  13. #include "log.h"
  14. int main(int argc, char* argv[])
  15. {
  16. QApplication a(argc, argv);
  17. #if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
  18. QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
  19. #endif
  20. // 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");
  21. // Log::setLevelFont(QtDebugMsg, {ConsoleFont::FORE_GROUND_BLUE});
  22. // Log::setOutLogPath("log_test/mlog.log");
  23. // Log::setLogSwitchover(LogSwitchoverType::FILE_SIZE, 5);
  24. // Log::setOutLogParamJsonPath("logjson/logsetting.json");
  25. // Log::setDistinguishLevel(true);
  26. //qInstallMessageHandler(Log::messageOutput);
  27. QFont f = a.font();
  28. f.setFamily("微软雅黑");
  29. a.setFont(f);
  30. QElapsedTimer cost;
  31. cost.start();
  32. #if 0
  33. LaunchPage w;
  34. w.show();
  35. #endif
  36. #if 1
  37. MainWindow w;
  38. qDebug() << "window build cost:" << cost.elapsed() << " ms";
  39. w.show();
  40. #endif
  41. return (a.exec());
  42. }