From 778ab87d8d2a8c834153bc68a88985d7cb5c0e9f Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 8 May 2009 14:51:43 +0200 Subject: Replace Q_ASSERT with return statement. The input context *can* receive events for unfocused widgets, namely when a CloseSoftwareInputPanel event is sent, or when a mouse event is sent to a nonfocusable widget. --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index bf50383..1ae3d79 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -207,7 +207,11 @@ QString QCoeFepInputContext::language() bool QCoeFepInputContext::filterEvent(const QEvent *event) { - Q_ASSERT(focusWidget()); + // The CloseSoftwareInputPanel event is not handled here, because the VK will automatically + // close when it discovers that the underlying widget does not have input capabilities. + + if (!focusWidget()) + return false; if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) { const QKeyEvent *keyEvent = static_cast(event); -- cgit v0.12