| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #include <QApplication>
- #include <QDir>
- #include "mainwindow.h"
- #include "logger.h"
- #include "appcontext.h"
- #include "version.h"
- #define SCREEN_WIDTH 1280
- #define SCREEN_HEIGHT 720
- int main(int argc, char *argv[])
- {
- #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- #endif
- QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
- QApplication app(argc, argv);
- #ifdef NDEBUG
- Logger::setup(Logger::INFO);
- #else
- Logger::setup(Logger::TRACE);
- #endif
- LOG_INFO("PROJECT_NAME: {}", PROJECT_NAME);
- LOG_INFO("PROJECT_VERSION: {}", PROJECT_VERSION);
- LOG_INFO("PROJECT_GIT_HASH: {}", PROJECT_GIT_HASH);
- LOG_INFO("PROJECT_GIT_BRANCH: {}", PROJECT_GIT_BRANCH);
- LOG_INFO("PROJECT_BUILD_TIME: {}", PROJECT_BUILD_TIME);
- AppContext &appCtx = AppContext::instance();
- ProjectManager &projectMgr = appCtx.projectManager();
- QString fileName = QString("%1/%2").arg(QDir::currentPath(), "conf/monitor.xml");
- bool result = projectMgr.openProject(fileName);
- if(result)
- {
- LOG_INFO("open monitor config xml success: {}, canvas count: {}", fileName.toUtf8().data(), projectMgr.canvasCount());
- }
- else
- {
- LOG_ERROR("open monitor config xml failed: {}", fileName.toUtf8().data());
- }
-
- MainWindow w;
- w.resize(SCREEN_WIDTH, SCREEN_HEIGHT);
- w.showFullScreen();
- int ret = app.exec();
- return ret;
- }
|