From 870b7820aee5a2fc3b4cee64e44ae2e99b6ae82d Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Sun, 25 Jul 2021 18:15:59 +0800 Subject: [PATCH] Fix Qt 5.15 compilation error Signed-off-by: Yuhang Zhao <2546789017@qq.com> --- framelesshelper.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/framelesshelper.cpp b/framelesshelper.cpp index b22bca8..c70d8ed 100644 --- a/framelesshelper.cpp +++ b/framelesshelper.cpp @@ -80,7 +80,11 @@ bool FramelessHelper::eventFilter(QObject *object, QEvent *event) const int titleBarHeight = FramelessWindowsManager::getTitleBarHeight(window); const bool resizable = FramelessWindowsManager::getResizable(window); const int windowWidth = window->width(); +#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) const QPointF localMousePosition = window->mapFromGlobal(Utilities::getGlobalMousePosition(window)); +#else + const QPoint localMousePosition = window->mapFromGlobal(Utilities::getGlobalMousePosition(window).toPoint()); +#endif const Qt::Edges edges = [window, resizeBorderWidth, resizeBorderHeight, windowWidth, &localMousePosition] { const int windowHeight = window->height(); if (localMousePosition.y() <= resizeBorderHeight) {