From 2d2fc799bc698ebf7e7c8bcc394366d0d7bf071b Mon Sep 17 00:00:00 2001 From: Sine Striker <trueful@163.com> Date: 周二, 20 2月 2024 18:18:39 +0800 Subject: [PATCH] Partially finish the bug after window close and reshow --- examples/qml/main.cpp | 17 ++++++++++++----- 1 files changed, 12 insertions(+), 5 deletions(-) diff --git a/examples/qml/main.cpp b/examples/qml/main.cpp index 75ca6e2..3daf57f 100644 --- a/examples/qml/main.cpp +++ b/examples/qml/main.cpp @@ -1,10 +1,15 @@ +// 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> int main(int argc, char *argv[]) { - qputenv("QT_WIN_DEBUG_CONSOLE", "1"); + qputenv("QT_WIN_DEBUG_CONSOLE", "attach"); qputenv("QSG_INFO", "1"); #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) qputenv("QT_QUICK_CONTROLS_STYLE", "Basic"); @@ -12,13 +17,15 @@ qputenv("QT_QUICK_CONTROLS_STYLE", "Default"); #endif #if 0 - qputenv("QSG_RHI_BACKEND", "d3d12"); - qputenv("QSG_RHI_HDR", "scrgb"); - qputenv("QT_QPA_DISABLE_REDIRECTION_SURFACE", "1"); -#endif + qputenv("QSG_RHI_BACKEND", "opengl"); + //qputenv("QSG_RHI_HDR", "scrgb"); + //qputenv("QT_QPA_DISABLE_REDIRECTION_SURFACE", "1"); 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