This commit is contained in:
zhuzihcu
2023-05-17 12:49:41 +08:00
parent 09dd381bbc
commit b93f91a73f
8 changed files with 63 additions and 18 deletions

View File

@ -12,17 +12,13 @@
int main(int argc, char *argv[])
{
//将样式设置为Basic不然会导致组件显示异常
FluentUI::init();
qputenv("QT_QUICK_CONTROLS_STYLE","Basic");
//6.4及以下监听系统深色模式变化
#ifdef Q_OS_WIN
qputenv("QT_QPA_PLATFORM","windows:darkmode=2");
#endif
FluentUI::preInit();
QGuiApplication::setOrganizationName("ZhuZiChu");
QGuiApplication::setOrganizationDomain("https://zhuzichu520.github.io");
QGuiApplication::setApplicationName("FluentUI");
// QQuickWindow::setGraphicsApi(QSGRendererInterface::Software);
QGuiApplication app(argc, argv);
FluentUI::postInit();
AppInfo* appInfo = new AppInfo();
IPC ipc(0);
QString activeWindowEvent = "activeWindow";
@ -47,7 +43,7 @@ int main(int argc, char *argv[])
});
context->setContextProperty("appInfo",appInfo);
const QUrl url(QStringLiteral("qrc:/example/qml/App.qml"));
// const QUrl url(QStringLiteral("qrc:/example/qml/TestWindow.qml"));
// const QUrl url(QStringLiteral("qrc:/example/qml/TestWindow.qml"));
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
&app, [url](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl)