From fc11377552b848dcb2b73f8bfb42185e32eac46e Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 7 May 2020 17:13:16 -0700 Subject: [PATCH] Fix build on Qt 5.11 and earlier --- app/gui/sdlgamepadkeynavigation.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/gui/sdlgamepadkeynavigation.cpp b/app/gui/sdlgamepadkeynavigation.cpp index 3c0fc84a..a6001485 100644 --- a/app/gui/sdlgamepadkeynavigation.cpp +++ b/app/gui/sdlgamepadkeynavigation.cpp @@ -250,7 +250,11 @@ void SdlGamepadKeyNavigation::sendWheel(QPoint& angleDelta) if (focusWindow != nullptr) { QPoint mousePos(focusWindow->width() / 2, focusWindow->height() / 2); QPoint globalPos(focusWindow->mapToGlobal(mousePos)); - QWheelEvent wheelEvent(mousePos, globalPos, QPoint(), angleDelta, 0, 0, Qt::NoScrollPhase, false, Qt::MouseEventSynthesizedByApplication); +#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) + QWheelEvent wheelEvent(mousePos, globalPos, QPoint(), angleDelta, Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false, Qt::MouseEventSynthesizedByApplication); +#else + QWheelEvent wheelEvent(mousePos, globalPos, QPoint(), angleDelta, angleDelta.y(), Qt::Vertical, Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, Qt::MouseEventSynthesizedByApplication, false); +#endif app->sendEvent(focusWindow, &wheelEvent); } }