Android JNI: update usage of QWindowSystemInterface::handleMouseEvent()
Follup to a37785ec76
: this API
has been deprecated since 5.11.
Pick-to: 5.15
Change-Id: Ib143f3997f89fc71d37d740338dae7df52ff45b4
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This commit is contained in:
parent
d8c843f05f
commit
4170fdfa59
@ -141,10 +141,9 @@ namespace QtAndroidInput
|
||||
QWindow *tlw = topLevelWindowAt(globalPos);
|
||||
m_mouseGrabber = tlw;
|
||||
QPoint localPos = tlw ? (globalPos - tlw->position()) : globalPos;
|
||||
QWindowSystemInterface::handleMouseEvent(tlw,
|
||||
localPos,
|
||||
globalPos,
|
||||
Qt::MouseButtons(Qt::LeftButton));
|
||||
QWindowSystemInterface::handleMouseEvent(tlw, localPos, globalPos,
|
||||
Qt::MouseButtons(Qt::LeftButton),
|
||||
Qt::LeftButton, QEvent::MouseButtonPress);
|
||||
}
|
||||
|
||||
static void mouseUp(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint x, jint y)
|
||||
@ -154,8 +153,9 @@ namespace QtAndroidInput
|
||||
if (!tlw)
|
||||
tlw = topLevelWindowAt(globalPos);
|
||||
QPoint localPos = tlw ? (globalPos -tlw->position()) : globalPos;
|
||||
QWindowSystemInterface::handleMouseEvent(tlw, localPos, globalPos
|
||||
, Qt::MouseButtons(Qt::NoButton));
|
||||
QWindowSystemInterface::handleMouseEvent(tlw, localPos, globalPos,
|
||||
Qt::MouseButtons(Qt::NoButton),
|
||||
Qt::LeftButton, QEvent::MouseButtonRelease);
|
||||
m_ignoreMouseEvents = false;
|
||||
m_mouseGrabber = 0;
|
||||
}
|
||||
@ -171,10 +171,9 @@ namespace QtAndroidInput
|
||||
if (!tlw)
|
||||
tlw = topLevelWindowAt(globalPos);
|
||||
QPoint localPos = tlw ? (globalPos-tlw->position()) : globalPos;
|
||||
QWindowSystemInterface::handleMouseEvent(tlw,
|
||||
localPos,
|
||||
globalPos,
|
||||
Qt::MouseButtons(m_mouseGrabber ? Qt::LeftButton : Qt::NoButton));
|
||||
QWindowSystemInterface::handleMouseEvent(tlw, localPos, globalPos,
|
||||
Qt::MouseButtons(m_mouseGrabber ? Qt::LeftButton : Qt::NoButton),
|
||||
Qt::NoButton, QEvent::MouseMove);
|
||||
}
|
||||
|
||||
static void mouseWheel(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint x, jint y, jfloat hdelta, jfloat vdelta)
|
||||
@ -212,16 +211,14 @@ namespace QtAndroidInput
|
||||
QPoint localPos = tlw ? (globalPos-tlw->position()) : globalPos;
|
||||
|
||||
// Release left button
|
||||
QWindowSystemInterface::handleMouseEvent(tlw,
|
||||
localPos,
|
||||
globalPos,
|
||||
Qt::MouseButtons(Qt::NoButton));
|
||||
QWindowSystemInterface::handleMouseEvent(tlw, localPos, globalPos,
|
||||
Qt::MouseButtons(Qt::NoButton), Qt::LeftButton,
|
||||
QEvent::MouseButtonRelease);
|
||||
|
||||
// Press right button
|
||||
QWindowSystemInterface::handleMouseEvent(tlw,
|
||||
localPos,
|
||||
globalPos,
|
||||
Qt::MouseButtons(Qt::RightButton));
|
||||
QWindowSystemInterface::handleMouseEvent(tlw, localPos, globalPos,
|
||||
Qt::MouseButtons(Qt::RightButton), Qt::RightButton,
|
||||
QEvent::MouseButtonPress);
|
||||
}
|
||||
|
||||
static void touchBegin(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/)
|
||||
|
Loading…
Reference in New Issue
Block a user