From 1dfdc0ce1b8ce3f3d37ebf12a03080a7b408f811 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Tue, 27 Feb 2018 16:25:04 -0300 Subject: [PATCH] Hide the selection cursor (android only) --- libraries/ui/src/ui/OffscreenQmlSurface.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libraries/ui/src/ui/OffscreenQmlSurface.cpp b/libraries/ui/src/ui/OffscreenQmlSurface.cpp index 32b68cd696..23a63c8f2a 100644 --- a/libraries/ui/src/ui/OffscreenQmlSurface.cpp +++ b/libraries/ui/src/ui/OffscreenQmlSurface.cpp @@ -1157,7 +1157,14 @@ bool OffscreenQmlSurface::eventFilter(QObject* originalDestination, QEvent* even if (_quickWindow && _quickWindow->activeFocusItem()) { event->ignore(); if (QCoreApplication::sendEvent(_quickWindow->activeFocusItem(), event)) { - return event->isAccepted(); + bool eventAccepted = event->isAccepted(); + QInputMethodQueryEvent* imqEvent = static_cast(event); + // this block disables the selection cursor in android which appears in + // the top-left corner of the screen + if (imqEvent->queries() & Qt::ImEnabled) { + imqEvent->setValue(Qt::ImEnabled, QVariant(false)); + } + return eventAccepted; } return false; }