MCPcopy Create free account
hub / github.com/Liniyous/ElaWidgetTools / main

Function main

ElaWidgetToolsExample/main.cpp:10–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include <Windows.h>
9#endif
10int main(int argc, char* argv[])
11{
12#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
13 QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
14#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
15 QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
16 QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
17#else
18 //根据实际屏幕缩放比例更改
19 qputenv("QT_SCALE_FACTOR", "1.5");
20#endif
21#endif
22 QApplication a(argc, argv);
23 eApp->init();
24 ElaLog::getInstance()->initMessageLog(false);
25 MainWindow w;
26 w.show();
27#ifdef Q_OS_WIN
28// HWND handle = FindWindowA(NULL, "ElaWidgetTool");
29// if (handle != NULL)
30// {
31// SetWindowDisplayAffinity(handle, WDA_EXCLUDEFROMCAPTURE);
32// }
33#endif
34 return a.exec();
35}

Callers

nothing calls this directly

Calls 1

initMethod · 0.80

Tested by

no test coverage detected