summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication.cpp
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-04-01 09:01:08 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-04-01 13:10:55 (GMT)
commit3ab68cbf5436e3e66d0297b01af661bedecb8766 (patch)
tree853a597d8d6e8509f80b9749b3087cf0e5ea3089 /src/gui/kernel/qapplication.cpp
parentf3dbe7d3ebac51b32cf7cc227032fa87a087c682 (diff)
downloadQt-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.cpp5
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;