From 91a692484f42bc817b4eb2496185059ea9799349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Thu, 28 Dec 2023 20:47:36 +0800 Subject: [PATCH] update --- src/CMakeLists.txt | 1 - src/FluFramelessHelper.cpp | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 167144ff..7a85bf03 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -65,7 +65,6 @@ if(QT_VERSION VERSION_GREATER_EQUAL "6.2") endforeach() endif() -#添加qml模块 if (FLUENTUI_BUILD_STATIC_LIB) set(LIB_TYPE "STATIC") else() diff --git a/src/FluFramelessHelper.cpp b/src/FluFramelessHelper.cpp index d71c9ea6..3d44d507 100644 --- a/src/FluFramelessHelper.cpp +++ b/src/FluFramelessHelper.cpp @@ -153,7 +153,7 @@ void FluFramelessHelper::_updateCursor(int edges){ } bool FluFramelessHelper::eventFilter(QObject *obj, QEvent *ev){ - if (!window.isNull() && window->flags() & Qt::FramelessWindowHint) { + if (!window.isNull() && window->flags()) { static int edges = 0; const int margin = 8; @@ -223,7 +223,9 @@ void FluFramelessHelper::componentComplete(){ } if(!window.isNull()){ #ifdef Q_OS_WIN +#if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3)) window->setFlags(window->flags() | Qt::FramelessWindowHint | Qt::WindowMinimizeButtonHint); +#endif _nativeEvent =new FramelessEventFilter(this); qApp->installNativeEventFilter(_nativeEvent); HWND hwnd = reinterpret_cast(window->winId()); @@ -234,6 +236,7 @@ void FluFramelessHelper::componentComplete(){ SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_THICKFRAME | WS_CAPTION); } showShadow(hwnd); + SetWindowPos(hwnd,nullptr,0,0,0,0,SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); #else window->setFlags((window->flags() & (~Qt::WindowMinMaxButtonsHint) & (~Qt::Dialog)) | Qt::FramelessWindowHint | Qt::Window); #endif