summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget.cpp
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@nokia.com>2009-07-10 17:15:25 (GMT)
committerPierre Rossi <pierre.rossi@nokia.com>2009-07-10 17:40:42 (GMT)
commitbaacf493e1c968ee2ffa59a8b87754388cb7a61a (patch)
tree2f411662090de28b4bb9563190f364ec570e18b5 /src/gui/kernel/qwidget.cpp
parent593f8a322895dc011d88fbe112987f2189d43724 (diff)
downloadQt-baacf493e1c968ee2ffa59a8b87754388cb7a61a.zip
Qt-baacf493e1c968ee2ffa59a8b87754388cb7a61a.tar.gz
Qt-baacf493e1c968ee2ffa59a8b87754388cb7a61a.tar.bz2
Fixed a crash with input methods
The inputContext's focusWidget was not reset when disabling input methods. Thanks to Benjamin P. Task-number: 257832 Reviewed-by: Denis
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r--src/gui/kernel/qwidget.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 9d40b00..fb9084e 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -9879,11 +9879,8 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
QInputContextPrivate::updateImeStatus(this, true);
#endif
QInputContext *ic = d->ic;
- if (!ic) {
- // implicitly create input context only if we have a focus
- if (hasFocus())
- ic = d->inputContext();
- }
+ if (!ic && (!on || hasFocus()))
+ ic = d->inputContext();
if (ic) {
if (on && hasFocus() && ic->focusWidget() != this) {
ic->setFocusWidget(this);