31 lines
951 B
C++
31 lines
951 B
C++
|
|
#include "APP/APP_UIWindow.h"
|
|||
|
|
#include "APP/APP_Theme.h"
|
|||
|
|
#include <QtCore/QCoreApplication>
|
|||
|
|
#include <QtWidgets/QApplication>
|
|||
|
|
#include <QtWidgets/QStyleFactory>
|
|||
|
|
|
|||
|
|
int main(int argc, char *argv[])
|
|||
|
|
{
|
|||
|
|
// 在创建 QApplication 之前开启高 DPI 缩放支持,
|
|||
|
|
// 让界面在高分屏缩放下保持正常显示。
|
|||
|
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|||
|
|
|
|||
|
|
// 高分屏下使用更清晰的图片和图标资源。
|
|||
|
|
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
|||
|
|
|
|||
|
|
// 创建 Qt 图形界面应用对象。
|
|||
|
|
QApplication app(argc, argv);
|
|||
|
|
|
|||
|
|
// 统一使用 Fusion 风格,减少系统主题差异。
|
|||
|
|
app.setStyle(QStyleFactory::create("Fusion"));
|
|||
|
|
|
|||
|
|
// 应用全局调色板和默认字体。
|
|||
|
|
app.setPalette(APP::APP_Theme::App_Func_GetPalette());
|
|||
|
|
app.setFont(APP::APP_Theme::App_Func_GetBodyFont());
|
|||
|
|
|
|||
|
|
APP::App_UIWindow window;
|
|||
|
|
window.show();
|
|||
|
|
|
|||
|
|
return app.exec();
|
|||
|
|
}
|