Fix build on Qt 5.11 and earlier
This commit is contained in:
parent
fbaa70a2ae
commit
fc11377552
1 changed files with 5 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue