diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-04-01 09:01:08 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-04-01 13:10:55 (GMT) |
commit | 3ab68cbf5436e3e66d0297b01af661bedecb8766 (patch) | |
tree | 853a597d8d6e8509f80b9749b3087cf0e5ea3089 /src/gui/kernel/qapplication.cpp | |
parent | f3dbe7d3ebac51b32cf7cc227032fa87a087c682 (diff) | |
download | Qt-3ab68cbf5436e3e66d0297b01af661bedecb8766.zip Qt-3ab68cbf5436e3e66d0297b01af661bedecb8766.tar.gz Qt-3ab68cbf5436e3e66d0297b01af661bedecb8766.tar.bz2 |
Give input context focus only when widget is enabled.
When disabling a widget that accepts keyboard input we disable input
context by calling QInputContext::setFocusWidget(0).
Reviewed-by: Prasanth Ullattil
Diffstat (limited to 'src/gui/kernel/qapplication.cpp')
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index c4224ed..8ede230 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -2086,8 +2086,9 @@ void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason) if(focus && QApplicationPrivate::focus_widget == focus) { if (focus->testAttribute(Qt::WA_InputMethodEnabled)) { QInputContext *qic = focus->inputContext(); - if (qic && focus_widget->testAttribute(Qt::WA_WState_Created)) - qic->setFocusWidget( focus_widget ); + if (qic && focus->testAttribute(Qt::WA_WState_Created) + && focus->isEnabled()) + qic->setFocusWidget(focus); } QFocusEvent in(QEvent::FocusIn, reason); QPointer<QWidget> that = focus; |