summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-17 14:27:48 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-17 14:27:48 (GMT)
commit62e641691b9a3eadc8b9fb2e31150cdf5b66115d (patch)
tree9033ae42f5b599e564421db69737ca0c70a85f53 /src/gui/kernel/qwidget.cpp
parente76c4c03c98091ee3e509a0f9b64daba472567ff (diff)
parente02859c3c7910ab3de0ec594fd493df946a5102d (diff)
downloadQt-62e641691b9a3eadc8b9fb2e31150cdf5b66115d.zip
Qt-62e641691b9a3eadc8b9fb2e31150cdf5b66115d.tar.gz
Qt-62e641691b9a3eadc8b9fb2e31150cdf5b66115d.tar.bz2
Merge remote branch 'mainline/4.6' into 4.6
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r--src/gui/kernel/qwidget.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 5a14cfe..4840d65 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -3084,9 +3084,10 @@ void QWidgetPrivate::setEnabled_helper(bool enable)
#endif
#ifndef QT_NO_IM
if (q->testAttribute(Qt::WA_InputMethodEnabled) && q->hasFocus()) {
- QInputContext *qic = inputContext();
+ QWidget *focusWidget = effectiveFocusWidget();
+ QInputContext *qic = focusWidget->d_func()->inputContext();
if (enable) {
- qic->setFocusWidget(q);
+ qic->setFocusWidget(focusWidget);
} else {
qic->reset();
qic->setFocusWidget(0);
@@ -10348,9 +10349,10 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
break; }
case Qt::WA_NativeWindow: {
#ifndef QT_NO_IM
+ QWidget *focusWidget = d->effectiveFocusWidget();
QInputContext *ic = 0;
if (on && !internalWinId() && testAttribute(Qt::WA_InputMethodEnabled) && hasFocus()) {
- ic = d->inputContext();
+ ic = focusWidget->d_func()->inputContext();
ic->reset();
ic->setFocusWidget(0);
}
@@ -10359,7 +10361,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
if (on && !internalWinId() && testAttribute(Qt::WA_WState_Created))
d->createWinId();
if (ic && isEnabled())
- ic->setFocusWidget(this);
+ ic->setFocusWidget(focusWidget);
#endif //QT_NO_IM
break;
}
@@ -10391,13 +10393,14 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
break;
case Qt::WA_InputMethodEnabled: {
#ifndef QT_NO_IM
- QInputContext *ic = d->ic;
+ QWidget *focusWidget = d->effectiveFocusWidget();
+ QInputContext *ic = focusWidget->d_func()->ic;
if (!ic && (!on || hasFocus()))
- ic = d->inputContext();
+ ic = focusWidget->d_func()->inputContext();
if (ic) {
- if (on && hasFocus() && ic->focusWidget() != this && isEnabled()) {
- ic->setFocusWidget(this);
- } else if (!on && ic->focusWidget() == this) {
+ if (on && hasFocus() && ic->focusWidget() != focusWidget && isEnabled()) {
+ ic->setFocusWidget(focusWidget);
+ } else if (!on && ic->focusWidget() == focusWidget) {
ic->reset();
ic->setFocusWidget(0);
}