Hide the selection cursor (android only)

This commit is contained in:
Gabriel Calero 2018-02-27 16:25:04 -03:00
parent efba05b9a0
commit 1dfdc0ce1b

View file

@ -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<QInputMethodQueryEvent*>(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;
}