From 6c0043c1e3d97398828fbd56448f1cd8ee201e66 Mon Sep 17 00:00:00 2001 From: Sine Striker <trueful@163.com> Date: 周五, 23 2月 2024 01:01:10 +0800 Subject: [PATCH] Fix bug of window closing and reshowing --- examples/qml/main.cpp | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/examples/qml/main.cpp b/examples/qml/main.cpp index 48dba90..3daf57f 100644 --- a/examples/qml/main.cpp +++ b/examples/qml/main.cpp @@ -1,5 +1,10 @@ +// Copyright (C) 2023-2024 Stdware Collections (https://www.github.com/stdware) +// Copyright (C) 2021-2023 wangwenx190 (Yuhang Zhao) +// SPDX-License-Identifier: Apache-2.0 + #include <QtGui/QGuiApplication> #include <QtQml/QQmlApplicationEngine> +#include <QtQuick/QQuickWindow> #include <QWKQuick/qwkquickglobal.h> @@ -15,10 +20,12 @@ qputenv("QSG_RHI_BACKEND", "opengl"); //qputenv("QSG_RHI_HDR", "scrgb"); //qputenv("QT_QPA_DISABLE_REDIRECTION_SURFACE", "1"); -#endif QGuiApplication::setHighDpiScaleFactorRoundingPolicy( Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); +#endif QGuiApplication application(argc, argv); + // Make sure alpha channel is requested, our special effects on Windows depends on it. + QQuickWindow::setDefaultAlphaBuffer(true); QQmlApplicationEngine engine; QWK::registerTypes(&engine); engine.load(QUrl(QStringLiteral("qrc:///main.qml"))); -- Gitblit v1.9.1