mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 04:08:13 +02:00
Fix backward compatibility with Qt 5.6
This commit is contained in:
parent
a1475bc65f
commit
f34faa3ee7
1 changed files with 10 additions and 1 deletions
|
@ -446,12 +446,21 @@ void Web3DOverlay::handlePointerEventAsTouch(const PointerEvent& event) {
|
||||||
//
|
//
|
||||||
// In Qt 5.9 mouse events must be sent before touch events to make sure some QtQuick components will
|
// In Qt 5.9 mouse events must be sent before touch events to make sure some QtQuick components will
|
||||||
// receive mouse events
|
// receive mouse events
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
|
||||||
if (!(this->_pressed && event.getType() == PointerEvent::Move)) {
|
if (!(this->_pressed && event.getType() == PointerEvent::Move)) {
|
||||||
QMouseEvent* mouseEvent = new QMouseEvent(mouseType, windowPoint, windowPoint, windowPoint, button, buttons, Qt::NoModifier);
|
QMouseEvent* mouseEvent = new QMouseEvent(mouseType, windowPoint, windowPoint, windowPoint, button, buttons, Qt::NoModifier);
|
||||||
QCoreApplication::postEvent(_webSurface->getWindow(), mouseEvent);
|
QCoreApplication::postEvent(_webSurface->getWindow(), mouseEvent);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
QCoreApplication::postEvent(_webSurface->getWindow(), touchEvent);
|
QCoreApplication::postEvent(_webSurface->getWindow(), touchEvent);
|
||||||
|
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5, 9, 0)
|
||||||
|
if (this->_pressed && event.getType() == PointerEvent::Move) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QMouseEvent* mouseEvent = new QMouseEvent(mouseType, windowPoint, windowPoint, windowPoint, button, buttons, Qt::NoModifier);
|
||||||
|
QCoreApplication::postEvent(_webSurface->getWindow(), mouseEvent);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Web3DOverlay::handlePointerEventAsMouse(const PointerEvent& event) {
|
void Web3DOverlay::handlePointerEventAsMouse(const PointerEvent& event) {
|
||||||
|
|
Loading…
Reference in a new issue