Fix Qt 5.15 compilation error

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2021-07-25 18:15:59 +08:00
parent da4269bbd6
commit 870b7820ae
1 changed files with 4 additions and 0 deletions

View File

@ -80,7 +80,11 @@ bool FramelessHelper::eventFilter(QObject *object, QEvent *event)
const int titleBarHeight = FramelessWindowsManager::getTitleBarHeight(window); const int titleBarHeight = FramelessWindowsManager::getTitleBarHeight(window);
const bool resizable = FramelessWindowsManager::getResizable(window); const bool resizable = FramelessWindowsManager::getResizable(window);
const int windowWidth = window->width(); const int windowWidth = window->width();
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
const QPointF localMousePosition = window->mapFromGlobal(Utilities::getGlobalMousePosition(window)); 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 Qt::Edges edges = [window, resizeBorderWidth, resizeBorderHeight, windowWidth, &localMousePosition] {
const int windowHeight = window->height(); const int windowHeight = window->height();
if (localMousePosition.y() <= resizeBorderHeight) { if (localMousePosition.y() <= resizeBorderHeight) {