From 7c9aa94533276d693942ed0ffb39d3d66a49e124 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Thu, 27 Apr 2023 10:59:09 +0400 Subject: [PATCH] Fix kUseNativeChild with Qt 6.4+ --- ui/gl/gl_window.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ui/gl/gl_window.cpp b/ui/gl/gl_window.cpp index fb4e0e6..0495700 100644 --- a/ui/gl/gl_window.cpp +++ b/ui/gl/gl_window.cpp @@ -24,6 +24,15 @@ namespace { constexpr auto kUseNativeChild = false;// ::Platform::IsWindows(); +class RpWidgetNoRhi : public RpWidget { +protected: +#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0) + std::optional rhiConfig() const override { + return QPlatformBackingStoreRhiConfig(); + } +#endif // Qt >= 6.4.0 +}; + class RpWindowNoRhi : public RpWindow { protected: #if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0) @@ -87,7 +96,7 @@ std::unique_ptr Window::createNativeBodyWrap( return nullptr; } const auto create = [] { - auto result = std::make_unique(); + auto result = std::make_unique(); result->setWindowFlags(Qt::FramelessWindowHint | Qt::Window); result->setAttribute(Qt::WA_NativeWindow); result->setAttribute(Qt::WA_DontCreateNativeAncestors);