2020-01-10 03:31:12 +00:00
|
|
|
#include "common/log.h"
|
2019-12-31 06:17:17 +00:00
|
|
|
#include "mainwindow.h"
|
|
|
|
#include "qthostinterface.h"
|
|
|
|
#include <QtWidgets/QApplication>
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
static void InitLogging()
|
|
|
|
{
|
|
|
|
// set log flags
|
2020-01-02 09:14:16 +00:00
|
|
|
#ifdef Y_BUILD_CONFIG_DEBUG
|
2020-01-10 03:31:12 +00:00
|
|
|
Log::SetConsoleOutputParams(true, nullptr, LOGLEVEL_DEBUG);
|
|
|
|
Log::SetFilterLevel(LOGLEVEL_DEBUG);
|
2020-01-02 09:14:16 +00:00
|
|
|
#else
|
2020-01-10 03:31:12 +00:00
|
|
|
Log::SetConsoleOutputParams(true, nullptr, LOGLEVEL_INFO);
|
|
|
|
Log::SetFilterLevel(LOGLEVEL_INFO);
|
2020-01-02 09:14:16 +00:00
|
|
|
#endif
|
2019-12-31 06:17:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
InitLogging();
|
|
|
|
|
2020-01-07 04:27:48 +00:00
|
|
|
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
|
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
|
|
|
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
|
|
|
#endif
|
2020-01-03 07:51:42 +00:00
|
|
|
|
2019-12-31 06:17:17 +00:00
|
|
|
QApplication app(argc, argv);
|
|
|
|
|
|
|
|
std::unique_ptr<QtHostInterface> host_interface = std::make_unique<QtHostInterface>();
|
|
|
|
|
|
|
|
std::unique_ptr<MainWindow> window = std::make_unique<MainWindow>(host_interface.get());
|
|
|
|
window->show();
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|