main.cpp 1.3 KB

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