From 0ee1b4a1dea8b587a5d39bfeb7e18c97f13dd877 Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Tue, 28 Feb 2012 13:35:17 +0200 Subject: Reverted use of tentative commit use in QWidget editors Feature to be reimplemented simplified. Cases when input method needs to be reset with possibility to commit use QInputMethod::commit() again. Change-Id: Ibfe7aecc0799e7a76c7ac4f5d860971cfe6e97ca Reviewed-by: Joona Petrell --- src/widgets/kernel/qapplication.cpp | 2 +- src/widgets/kernel/qwidget.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/widgets/kernel') diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 2615ac891d..a099faae3f 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -2042,7 +2042,7 @@ void QApplication::setActiveWindow(QWidget* act) if (QApplicationPrivate::focus_widget) { if (QApplicationPrivate::focus_widget->testAttribute(Qt::WA_InputMethodEnabled)) - qApp->inputMethod()->reset(); + qApp->inputMethod()->commit(); QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange, Qt::ActiveWindowFocusReason); QApplication::sendEvent(QApplicationPrivate::focus_widget, &focusAboutToChange); diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 9a32d952f9..cccde764ad 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -3090,7 +3090,7 @@ void QWidgetPrivate::setEnabled_helper(bool enable) if (focusWidget->testAttribute(Qt::WA_InputMethodEnabled)) qApp->inputMethod()->update(Qt::ImEnabled); } else { - qApp->inputMethod()->reset(); + qApp->inputMethod()->commit(); qApp->inputMethod()->update(Qt::ImEnabled); } } @@ -5948,7 +5948,7 @@ void QWidget::setFocus(Qt::FocusReason reason) if (prev) { if (reason != Qt::PopupFocusReason && reason != Qt::MenuBarFocusReason && prev->testAttribute(Qt::WA_InputMethodEnabled)) { - qApp->inputMethod()->reset(); + qApp->inputMethod()->commit(); } if (reason != Qt::NoFocusReason) { @@ -6057,7 +6057,7 @@ void QWidget::clearFocus() { if (hasFocus()) { if (testAttribute(Qt::WA_InputMethodEnabled)) - qApp->inputMethod()->reset(); + qApp->inputMethod()->commit(); QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange); QApplication::sendEvent(this, &focusAboutToChange); @@ -10087,7 +10087,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) QWidget *focusWidget = d->effectiveFocusWidget(); if (on && !internalWinId() && hasFocus() && focusWidget->testAttribute(Qt::WA_InputMethodEnabled)) { - qApp->inputMethod()->reset(); + qApp->inputMethod()->commit(); qApp->inputMethod()->update(Qt::ImEnabled); } if (!qApp->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) && parentWidget() @@ -10137,7 +10137,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) #ifndef QT_NO_IM if (qApp->focusObject() == this) { if (!on) - qApp->inputMethod()->reset(); + qApp->inputMethod()->commit(); qApp->inputMethod()->update(Qt::ImEnabled); } #endif //QT_NO_IM -- cgit v1.2.3