summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidgetwindow_qpa.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel/qwidgetwindow_qpa.cpp')
-rw-r--r--src/widgets/kernel/qwidgetwindow_qpa.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwidgetwindow_qpa.cpp b/src/widgets/kernel/qwidgetwindow_qpa.cpp
index 498908f4db..aa7ccfeb4f 100644
--- a/src/widgets/kernel/qwidgetwindow_qpa.cpp
+++ b/src/widgets/kernel/qwidgetwindow_qpa.cpp
@@ -99,6 +99,15 @@ bool QWidgetWindow::event(QEvent *event)
case QEvent::FocusOut:
return false;
+ case QEvent::FocusAboutToChange:
+ if (QApplicationPrivate::focus_widget) {
+ if (QApplicationPrivate::focus_widget->testAttribute(Qt::WA_InputMethodEnabled))
+ qApp->inputMethod()->commit();
+
+ QGuiApplication::sendSpontaneousEvent(QApplicationPrivate::focus_widget, event);
+ }
+ return true;
+
case QEvent::KeyPress:
case QEvent::KeyRelease:
handleKeyEvent(static_cast<QKeyEvent *>(event));