diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-01-13 11:39:21 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-01-13 11:39:21 +0100 |
commit | 3aca005d4721b82446922310496271ebe206a0d7 (patch) | |
tree | f71298b19bd98c6b3751bc9009b2fdb49c2ad526 /src/gui/kernel/qwidget.cpp | |
parent | 6088336d9237eaa94def8c2a83901b547e682abb (diff) | |
parent | 48e08ee5718b3de855ecea626179ad5323e38fa0 (diff) | |
download | qt4-tools-3aca005d4721b82446922310496271ebe206a0d7.tar.gz |
Merge remote branch 'mainline/4.6' into 4.6
Conflicts:
tests/auto/linguist/lupdate/testlupdate.cpp
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 5c4cc74990..81a9a80af8 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** @@ -3088,7 +3088,8 @@ void QWidgetPrivate::setEnabled_helper(bool enable) QWidget *focusWidget = effectiveFocusWidget(); QInputContext *qic = focusWidget->d_func()->inputContext(); if (enable) { - qic->setFocusWidget(focusWidget); + if (focusWidget->testAttribute(Qt::WA_InputMethodEnabled)) + qic->setFocusWidget(focusWidget); } else { qic->reset(); qic->setFocusWidget(0); @@ -10357,17 +10358,22 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) #ifndef QT_NO_IM QWidget *focusWidget = d->effectiveFocusWidget(); QInputContext *ic = 0; - if (on && !internalWinId() && testAttribute(Qt::WA_InputMethodEnabled) && hasFocus()) { + if (on && !internalWinId() && hasFocus() + && focusWidget->testAttribute(Qt::WA_InputMethodEnabled)) { ic = focusWidget->d_func()->inputContext(); - ic->reset(); - ic->setFocusWidget(0); + if (ic) { + ic->reset(); + ic->setFocusWidget(0); + } } if (!qApp->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) && parentWidget()) parentWidget()->d_func()->enforceNativeChildren(); if (on && !internalWinId() && testAttribute(Qt::WA_WState_Created)) d->createWinId(); - if (ic && isEnabled()) + if (ic && isEnabled() && focusWidget->isEnabled() + && focusWidget->testAttribute(Qt::WA_InputMethodEnabled)) { ic->setFocusWidget(focusWidget); + } #endif //QT_NO_IM break; } @@ -10404,7 +10410,8 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) if (!ic && (!on || hasFocus())) ic = focusWidget->d_func()->inputContext(); if (ic) { - if (on && hasFocus() && ic->focusWidget() != focusWidget && isEnabled()) { + if (on && hasFocus() && ic->focusWidget() != focusWidget && isEnabled() + && focusWidget->testAttribute(Qt::WA_InputMethodEnabled)) { ic->setFocusWidget(focusWidget); } else if (!on && ic->focusWidget() == focusWidget) { ic->reset(); |