Commit bed25d8a authored by Richard Moe Gustavsen's avatar Richard Moe Gustavsen Committed by Jani Heikkinen
Browse files

iOS: let focusobject be ImEnabled when a menu is attached


Since the picker menu uses IM to set an alternative
input view, we also need to specify that we IM is enabled.

Task-number: QTBUG-42523
Change-Id: Ia559fbc0ca7e6a1a4499d5eb179baa2d915ecb17
Reviewed-by: default avatarTor Arne Vestbø <tor.arne.vestbo@digia.com>
Showing with 3 additions and 2 deletions
...@@ -452,11 +452,11 @@ void QIOSMenu::toggleShowUsingUIPickerView(bool show) ...@@ -452,11 +452,11 @@ void QIOSMenu::toggleShowUsingUIPickerView(bool show)
Q_ASSERT(!focusObjectWithPickerView); Q_ASSERT(!focusObjectWithPickerView);
focusObjectWithPickerView = qApp->focusWindow()->focusObject(); focusObjectWithPickerView = qApp->focusWindow()->focusObject();
focusObjectWithPickerView->installEventFilter(this); focusObjectWithPickerView->installEventFilter(this);
qApp->inputMethod()->update(Qt::ImPlatformData); qApp->inputMethod()->update(Qt::ImEnabled | Qt::ImPlatformData);
} else { } else {
Q_ASSERT(focusObjectWithPickerView); Q_ASSERT(focusObjectWithPickerView);
focusObjectWithPickerView->removeEventFilter(this); focusObjectWithPickerView->removeEventFilter(this);
qApp->inputMethod()->update(Qt::ImPlatformData); qApp->inputMethod()->update(Qt::ImEnabled | Qt::ImPlatformData);
focusObjectWithPickerView = 0; focusObjectWithPickerView = 0;
Q_ASSERT(m_pickerView); Q_ASSERT(m_pickerView);
...@@ -477,6 +477,7 @@ bool QIOSMenu::eventFilter(QObject *obj, QEvent *event) ...@@ -477,6 +477,7 @@ bool QIOSMenu::eventFilter(QObject *obj, QEvent *event)
imPlatformData.insert(kImePlatformDataInputView, QVariant::fromValue(static_cast<void *>(m_pickerView))); imPlatformData.insert(kImePlatformDataInputView, QVariant::fromValue(static_cast<void *>(m_pickerView)));
imPlatformData.insert(kImePlatformDataInputAccessoryView, QVariant::fromValue(static_cast<void *>(m_pickerView.toolbar))); imPlatformData.insert(kImePlatformDataInputAccessoryView, QVariant::fromValue(static_cast<void *>(m_pickerView.toolbar)));
queryEvent->setValue(Qt::ImPlatformData, imPlatformData); queryEvent->setValue(Qt::ImPlatformData, imPlatformData);
queryEvent->setValue(Qt::ImEnabled, true);
return true; return true;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment